예제 #1
0
 @Override
 public void onBackPressed() {
   // Don't allow the back button to finish this activity before things are done
   if (finished) {
     super.onBackPressed();
   }
 }
예제 #2
0
    @Override
    protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      from = getIntent().getIntExtra(TOKEN_FROM_VERSION, -1);
      if (from > 0) {
        dialog = dialogBuilder.newProgressDialog(R.string.DLG_upgrading);
        new Thread() {
          @Override
          public void run() {
            //noinspection EmptyTryBlock
            try {

            } finally {
              finished = true;
              DialogUtilities.dismissDialog(UpgradeActivity.this, dialog);
              sendBroadcast(new Intent(AstridApiConstants.BROADCAST_EVENT_REFRESH));
              setResult(AstridActivity.RESULT_RESTART_ACTIVITY);
              finish();
            }
          }
        }.start();
      } else {
        finished = true;
        finish();
      }
    }
예제 #3
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    preferences.applyThemeAndStatusBarColor();

    setContentView(R.layout.custom_filter_activity);
    ButterKnife.inject(this);

    setSupportActionBar(toolbar);
    ActionBar supportActionBar = getSupportActionBar();
    if (supportActionBar != null) {
      supportActionBar.setDisplayHomeAsUpEnabled(true);
      supportActionBar.setHomeAsUpIndicator(R.drawable.ic_close_white_24dp);
      supportActionBar.setTitle(R.string.FLA_new_filter);
    }

    listView = (ListView) findViewById(android.R.id.list);

    database.openForReading();

    List<CriterionInstance> startingCriteria = new ArrayList<>();
    startingCriteria.add(getStartingUniverse());
    adapter = new CustomFilterAdapter(this, dialogBuilder, startingCriteria);
    listView.setAdapter(adapter);
    updateList();

    setUpListeners();
  }
예제 #4
0
  @Override
  protected void onNewIntent(Intent intent) {
    super.onNewIntent(intent);

    setIntent(intent);

    launchTaskList();
  }
예제 #5
0
 @Override
 public void finish() {
   InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
   imm.hideSoftInputFromWindow(filterName.getWindowToken(), 0);
   super.finish();
   AndroidUtilities.callOverridePendingTransition(
       this, R.anim.slide_right_in, R.anim.slide_right_out);
 }
예제 #6
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    launchTaskList();
  }