示例#1
0
  @Override
  protected void onNewIntent(Intent intent) {
    super.onNewIntent(intent);

    if (intent != null) {
      final Message messageJustPublished = intent.<Message>getParcelableExtra(EXTRA_NEW_MESSAGE);
      if (messageJustPublished != null) {
        // add the newly published message to the top of the list
        mAdapter.insert(messageJustPublished, 0);
      }
    }
  }
示例#2
0
 @Override
 public void onBackPressed() {
   // if we are already on the home tab
   if (mMode == DEFAULT_MODE) {
     // just perform the normal back key actions
     super.onBackPressed();
   }
   // if we are on another tab
   else {
     // first go back to the home tab
     mMode = DEFAULT_MODE;
     reloadMessages(mMode, 0, true, false, false);
   }
 }