コード例 #1
0
 @Override
 protected void onListItemClick(ListView l, View v, int position, long id) {
   RssItem item = rssList.get(position);
   Intent intent = new Intent(RssReaderActivity.this, RssDetailActivity.class);
   intent.putExtra("rss_title", item.getTitle());
   intent.putExtra("rss_link", item.getLink());
   RssReaderActivity.this.startActivity(intent);
 }
コード例 #2
0
  void acctSelected(ServiceAcctInfo info) {
    Account acct = new Account();
    acct.name = info.desc;
    acct.service = info;

    DialogInterface.OnClickListener emptyClickListener =
        new DialogInterface.OnClickListener() {
          public void onClick(DialogInterface dialog, int which) {}
        };

    AcctTables db = new AcctTables(this);
    try {
      db.openWritable();

      try {
        db.pushAccount(acct);
      } catch (SQLiteException e) {
        AlertDialog dlg =
            Utilities.buildAlert(
                this, e, "Unable to add account", "Internal Error", emptyClickListener);
        dlg.show();
        return;
      }
    } finally {
      db.close();
    }

    Intent i = getIntent();
    i.putExtra("acct_id", acct.ID);
    setResult(RESULT_OK, i);
    finish();
  }
コード例 #3
0
 /**
  * When the back button is pressed, update the MidiOptions. Return the updated options as the
  * 'result' of this Activity.
  */
 @Override
 public void onBackPressed() {
   Intent intent = new Intent();
   updateOptions();
   intent.putExtra(SettingsActivity.settingsID, options);
   setResult(Activity.RESULT_OK, intent);
   super.onBackPressed();
 }
コード例 #4
0
 public void addEnvToIntent(Intent intent) {
   Map<String, String> envMap = System.getenv();
   Set<Map.Entry<String, String>> envSet = envMap.entrySet();
   Iterator<Map.Entry<String, String>> envIter = envSet.iterator();
   int c = 0;
   while (envIter.hasNext()) {
     Map.Entry<String, String> entry = envIter.next();
     intent.putExtra("env" + c, entry.getKey() + "=" + entry.getValue());
     c++;
   }
 }
コード例 #5
0
 @Override
 public void onItemClick(AdapterView<?> l, View v, int position, long id) {
   if (l.getId() == R.id.photosGridView) {
     String clickedItem = photosGridViewContents[position];
     Intent intent = new Intent(PhotoGridActivity.this, PhotoViewerActivity.class);
     intent.putExtra(
         "filename",
         clickedItem); // use putExtra method of Intent here for passing additional information to
                       // PhotoViewerActivity
     startActivity(intent);
   }
 }
コード例 #6
0
  private void finishWithPath(String path) {
    if (pathSettingKey != null && !pathSettingKey.isEmpty()) {
      SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
      SharedPreferences.Editor editor = settings.edit();
      editor.putString(pathSettingKey, path);
      editor.commit();
    }

    Intent intent = new Intent();
    intent.putExtra("PATH", path);
    setResult(RESULT_OK, intent);
    finish();
  }
コード例 #7
0
ファイル: AC_Loading.java プロジェクト: YangTaeYeong/cliqr
        @Override
        public void onFinish() {
          Intent intent;

          if (mPref.getCheckedTutorial() == true) {
            // 튜토리얼을 했을 경우
            intent = new Intent(AC_Loading.this, AC_Main.class);
          } else {
            // 튜토리얼을 안했을 경우
            intent = new Intent(AC_Loading.this, AC_Help_tutorial.class);
          }
          intent.putExtra("tutorial", true);
          intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
          startActivity(intent);
          overridePendingTransition(R.anim.fadein, R.anim.fadeout);
          cTimer.cancel();
          finish();
        }
コード例 #8
0
 void loginFailure() {
   Intent loginProf = new Intent(this, Login.class);
   loginProf.putExtra("prof_id", profileId);
   if (this.session != null) loginProf.putExtra("sess_id", this.session.ID);
   startActivityForResult(loginProf, GET_SESSION);
 }