in SharingShortcuts/Application/src/main/java/com/example/android/sharingshortcuts/SendMessageActivity.java [55:77]
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_send_message);
setTitle(R.string.sending_message);
// View references.
mTextContactName = findViewById(R.id.contact_name);
mTextMessageBody = findViewById(R.id.message_body);
// Handle the share Intent.
boolean handled = handleIntent(getIntent());
if (!handled) {
finish();
return;
}
// Bind event handlers.
findViewById(R.id.send).setOnClickListener(mOnClickListener);
// Set up the UI.
prepareUi();
// The contact ID will not be passed on when the user clicks on the app icon rather than any
// of the Direct Share icons. In this case, we show another dialog for selecting a contact.
if (mContactId == Contact.INVALID_ID) {
selectContact();
}
}