@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.compose_message_activity, container, false); fullFromText = (TextView) v.findViewById(R.id.subject); fromText = (TextView) v.findViewById(R.id.subjectLabel); bodyInput = (EditText) v.findViewById(R.id.embedded_text_editor); accountChooserButton = (AccountChooserButton) v.findViewById(R.id.accountChooserButton); sendButton = (Button) v.findViewById(R.id.send_button); accountChooserButton.setShowExternals(false); return v; }
private void sendMessage() { if (service != null) { SipProfile acc = accountChooserButton.getSelectedAccount(); if (acc != null && acc.id != SipProfile.INVALID_ID) { try { String textToSend = bodyInput.getText().toString(); if (!TextUtils.isEmpty(textToSend)) { service.sendMessage(textToSend, remoteFrom, (int) acc.id); bodyInput.getText().clear(); } } catch (RemoteException e) { Log.e(THIS_FILE, "Not able to send message"); } } } }