@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); }
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(); }
/** * 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(); }
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++; } }
@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); } }
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(); }
@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(); }
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); }