List of usage examples for android.content Intent putExtras
public @NonNull Intent putExtras(@NonNull Bundle extras)
From source file:edu.mit.media.funf.configured.ConfiguredPipeline.java
public void onDataReceived(Bundle data) { String dataJson = getBundleSerializer().serialize(data); String probeName = data.getString(Probe.PROBE); long timestamp = data.getLong(Probe.TIMESTAMP, 0L); Bundle b = new Bundle(); b.putString(NameValueDatabaseService.DATABASE_NAME_KEY, getPipelineName()); b.putLong(NameValueDatabaseService.TIMESTAMP_KEY, timestamp); b.putString(NameValueDatabaseService.NAME_KEY, probeName); b.putString(NameValueDatabaseService.VALUE_KEY, dataJson); Intent i = new Intent(this, getDatabaseServiceClass()); i.setAction(DatabaseService.ACTION_RECORD); i.putExtras(b); startService(i);/*from w ww . ja va 2 s. co m*/ }
From source file:com.garlicg.screenrecord4cm.SettingsActivity.java
@Override public void finish() { // ?????//from w w w .j a v a 2s. co m // RecentTask????????? ResultBundleBuilder builder = new ResultBundleBuilder(this); builder.add(new StartRecordTrigger(this)); Intent intent = new Intent(); intent.putExtras(builder.build()); setResult(RESULT_OK, intent); super.finish(); }
From source file:com.cpjd.roblu.ui.images.ImageGalleryActivity.java
/** * The user selected an image, send it to the full screen image gallery activity * @param position the position of the image *//*from www . j a v a 2 s .c o m*/ @Override public void onImageClick(int position) { Intent intent = new Intent(ImageGalleryActivity.this, FullScreenImageGalleryActivity.class); Bundle bundle = new Bundle(); bundle.putInt("position", position); bundle.putBoolean("editable", editable); intent.putExtras(bundle); startActivityForResult(intent, Constants.GENERAL); }
From source file:com.parse.CN1ParsePushBroadcastReceiver.java
@Override protected void onPushOpen(Context context, Intent intent) { /*//w w w.j av a 2s. c om Adapted from ParsePushBroadcastReceiver. Main changes: 1. Adapted code for starting app activity since it caused problems (see comments towards the end of the method starting from line 'Original code' 2. Implemented necessary ParsePush callback to set push data in advance so that it will be available when the app activity is started/resumed */ // Send a Parse Analytics "push opened" event ParseAnalytics.trackAppOpenedInBackground(intent); JSONObject pushData = null; String uriString = null; try { pushData = new JSONObject(intent.getStringExtra(ParsePushBroadcastReceiver.KEY_PUSH_DATA)); uriString = pushData.optString("uri", null); } catch (JSONException e) { writeErrorLog("Unexpected JSONException when parsing " + "push data from opened notification: " + e); } writeDebugLog("Push opened: " + (pushData == null ? "<no payload>" : pushData.toString())); if (pushData != null) { // Forward payload so that it is available when app is opened via the push message ParsePush.handlePushOpen(pushData.toString(), CN1AndroidApplication.isAppInForeground()); writeDebugLog("Notified ParsePush of opened push notification"); } Class<? extends Activity> cls = getActivity(context, intent); Intent activityIntent; if (uriString != null) { writeDebugLog("Creating an intent to view URI: " + uriString); activityIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(uriString)); } else { activityIntent = new Intent(context, cls); } activityIntent.putExtras(intent.getExtras()); activityIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); activityIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); // Original code // /* // In order to remove dependency on android-support-library-v4 // The reason why we differentiate between versions instead of just using context.startActivity // for all devices is because in API 11 the recommended conventions for app navigation using // the back key changed. // */ // if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { // TaskStackBuilderHelper.startActivities(context, cls, activityIntent); // } else { // context.startActivity(activityIntent); // } // The task stack builder approach causes only the title and a white (blank) screen // to be shown when the app is in the foreground and the push notification is // opened (see also problem report to CN1 support forum: https://groups.google.com/d/msg/codenameone-discussions/Z3F924j_BG4/7rn7v7oABwAJ) // As a result, the context.startActivity() approach is currently taken always. // Not sure yet if it has any undesirable side effects for sdk version // before JELLY_BEAN (actually HONEYCOMB (v3.0) according to TaskStackBuilder documentation // at: http://developer.android.com/reference/android/support/v4/app/TaskStackBuilder.html. context.startActivity(activityIntent); }
From source file:com.example.sergey.currentweather.ui.fragment.MainFragment.java
@Override public void CityListItemClicked(View v, long position) { Intent intent = new Intent(getActivity(), DetailActivity.class); Bundle bundle = new Bundle(); bundle.putLong("position", position); intent.putExtras(bundle); startActivity(intent);// www . j a v a 2s. com CustomAnimationUtils.fromLeftToRightHide(fab, getContext()); }
From source file:com.easemob.chatuidemo.activity.homework.HomeworkListTeacherActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_homeworklist_teacher); instance = this; HomeworkListView = (ListView) findViewById(R.id.lv_homework_list); swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_layout); swipeRefreshLayout.setColorSchemeResources(android.R.color.holo_blue_bright, android.R.color.holo_green_light, android.R.color.holo_orange_light, android.R.color.holo_red_light); swipeRefreshLayout.setOnRefreshListener(new OnRefreshListener() { @Override//from w w w. j a v a 2 s . co m public void onRefresh() { new GetDataThread(handler).start(); } }); mAdapter = new HomeworkAdapter(this, infos); HomeworkListView.setAdapter(mAdapter); HomeworkListView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Intent intent = new Intent(HomeworkListTeacherActivity.this, HomeworkInfoContentActivity.class); Bundle extras = new Bundle(); extras.putString("id", mReturnData.get(position).get("id").toString()); extras.putString("nick", EMChatManager.getInstance().getCurrentUser()); intent.putExtras(extras); startActivity(intent); } }); DialogDemo.show(this, "??..."); new GetDataThread(handler).start(); }
From source file:com.chess.genesis.net.GenesisNotifier.java
private void SendNotification(final int id, final String text) { final Intent intent; if (Pref.getBool(this, R.array.pf_tabletMode)) { intent = new Intent(this, MainMenuTablet.class); final Bundle bundle = new Bundle(); bundle.putInt("loadFrag", Enums.ONLINE_LIST); intent.putExtras(bundle); } else {/* w ww . j ava 2 s .c om*/ intent = new Intent(this, GameListOnline.class); } final PendingIntent pintent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); final NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); final Notification note = createNotification(id, text, pintent); nm.notify(id, note); }
From source file:com.bonsai.wallet32.MainActivity.java
public void viewAccount(View view) { int accountId = view.getId(); Intent intent = new Intent(this, ViewAccountActivity.class); Bundle bundle = new Bundle(); bundle.putInt("accountId", accountId); intent.putExtras(bundle); startActivity(intent);/* ww w .ja v a2 s . c o m*/ }
From source file:gov.wa.wsdot.android.wsdot.ui.FerriesRouteSchedulesDaySailingsFragment.java
@Override public void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); String terminalNames = scheduleDateItems.get(0).getFerriesTerminalItem().get(position) .getDepartingTerminalName() + " to " + scheduleDateItems.get(0).getFerriesTerminalItem().get(position).getArrivingTerminalName(); Bundle b = new Bundle(); Intent intent = new Intent(getActivity(), FerriesRouteSchedulesDayDeparturesActivity.class); b.putString("terminalNames", terminalNames); b.putInt("position", position); b.putSerializable("scheduleDateItems", scheduleDateItems); intent.putExtras(b); startActivity(intent);//from ww w . j a v a2s . co m }
From source file:com.example.maciej.mytask.MainActivity.java
public void descriptionClicked(View view) { CheckedTextView item = (CheckedTextView) view; String item_name = item.getText().toString(); int index = mNameList.indexOf(item_name); String item_description = mDescriptionList.get(index); String item_date = mDateList.get(index); Intent intent = new Intent(MainActivity.this, DescriptionActivity.class); Bundle extras = new Bundle(); extras.putString(EXTRA_TASK_NAME, item_name); extras.putString(EXTRA_TASK_DESCRIPTION, item_description); extras.putString(EXTRA_TASK_DATE, item_date); intent.putExtras(extras); startActivityForResult(intent, MODIFY_TASK_REQUEST); }