private void sendMessage(final Activity activity) { SharedPreferences prefs = activity.getSharedPreferences(Constants.PREF_NAME, Context.MODE_PRIVATE); prefs .edit() .putBoolean(Constants.PREF_KEY_MESSAGE_CENTER_SHOULD_SHOW_INTRO_DIALOG, false) .commit(); // Save the email. if (interaction.isAskForEmail()) { if (email != null && email.length() != 0) { PersonManager.storePersonEmail(activity, email.toString()); Person person = PersonManager.storePersonAndReturnDiff(activity); if (person != null) { Log.d("Person was updated."); Log.v(person.toString()); ApptentiveDatabase.getInstance(activity).addPayload(person); } else { Log.d("Person was not updated."); } } } // Send the message. final TextMessage textMessage = new TextMessage(); textMessage.setBody(message.toString()); textMessage.setRead(true); /* // TODO: Figure out how to add custom data here. textMessage.setCustomData(customData); customData = null; */ MessageManager.sendMessage(activity, textMessage); }
public void setPersonEmail(@SuppressWarnings("unused") View view) { EditText emailText = (EditText) findViewById(R.id.set_person_email); String email = (emailText).getText().toString().trim(); emailText.setText(null); PersonManager.storePersonEmail(this, email); }