コード例 #1
0
  @Override
  public void onResume() {
    super.onResume();
    ActivityMonitor.getInstance().setCurrentActivity(this);

    if (!(preferences.getEmail().equals("")
        || preferences.getPassword().equals("")
        || preferences.getDid().equals(""))) {
      preRecentUpdate();
    } else {
      AlertDialog.Builder builder = new AlertDialog.Builder(this);
      builder.setMessage(getString(R.string.conversations_first_run_dialog_text));
      builder.setPositiveButton(
          getString(R.string.preferences_name),
          new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int id) {
              Intent preferencesIntent =
                  new Intent(conversationsActivity, PreferencesActivity.class);
              startActivity(preferencesIntent);
            }
          });
      builder.setNegativeButton(
          getString(R.string.help_name),
          new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int id) {
              Intent helpIntent = new Intent(conversationsActivity, HelpActivity.class);
              startActivity(helpIntent);
            }
          });
      builder.setCancelable(false);
      builder.show();
    }
  }
コード例 #2
0
 @Override
 protected void onDestroy() {
   super.onDestroy();
   ActivityMonitor.getInstance().deleteReferenceToActivity(this);
 }