List of usage examples for android.os Bundle putStringArray
public void putStringArray(@Nullable String key, @Nullable String[] value)
From source file:org.mozilla.gecko.overlays.ui.ShareDialog.java
@Override public void onSendTabTargetSelected(String targetGUID) { // targetGUID being null with no override intent should be an impossible state. Assert.isTrue(targetGUID != null);/*from ww w . j a v a2 s .co m*/ Intent serviceIntent = getServiceIntent(ShareMethod.Type.SEND_TAB); // Currently, only one extra parameter is necessary (the GUID of the target device). Bundle extraParameters = new Bundle(); // Future: Handle multiple-selection. Bug 1061297. extraParameters.putStringArray(SendTab.SEND_TAB_TARGET_DEVICES, new String[] { targetGUID }); serviceIntent.putExtra(OverlayConstants.EXTRA_PARAMETERS, extraParameters); startService(serviceIntent); slideOut(); Telemetry.sendUIEvent(TelemetryContract.Event.SHARE, TelemetryContract.Method.SHARE_OVERLAY, "sendtab"); }
From source file:fr.cph.chicago.core.activity.BusMapActivity.java
@Override public void onSaveInstanceState(final Bundle savedInstanceState) { savedInstanceState.putInt(bundleBusId, busId); savedInstanceState.putString(bundleBusRouteId, busRouteId); savedInstanceState.putStringArray(bundleBusBounds, bounds); super.onSaveInstanceState(savedInstanceState); }
From source file:net.simonvt.fragmentstack.FragmentStack.java
public void saveState(Bundle outState) { executePendingTransactions();/*from w ww .ja va 2 s. c om*/ final int stackSize = stack.size(); String[] stackTags = new String[stackSize]; int i = 0; for (Fragment f : stack) { stackTags[i++] = f.getTag(); } outState.putStringArray(STATE_STACK, stackTags); }
From source file:de.tudarmstadt.dvs.myhealthassistant.myhealthhub.MyHealthHubGlassMainActivity.java
private void openSelectSensorType(Bundle extras, String sensorType, String[] names) { DialogFragment deviceDialog = new SelectDeviceDialogFragment(); extras.putInt("position", 0); extras.putBoolean("device", false); extras.putString("sensorType", sensorType); extras.putStringArray("names", names); deviceDialog.setArguments(extras);//from w w w. j a v a2 s .com getFragmentManager().beginTransaction(); deviceDialog.show(getSupportFragmentManager().beginTransaction(), "deviceDialog"); }
From source file:ca.rmen.android.poetassistant.main.MainActivity.java
@Override protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); // If the user cleared the search history, let's save this info in case the device // is rotated, so we can show the snackbar again. if (mClearedHistory != null) { outState.putStringArray(EXTRA_CLEARED_HISTORY, mClearedHistory); }/* w w w. j a va 2 s. c o m*/ }
From source file:tv.ouya.sdk.OuyaUnityPlugin.java
public static void initOuyaPlugin(final String jsonData) { Activity activity = IOuyaActivity.GetActivity(); if (null != activity) { Runnable runnable = new Runnable() { public void run() { try { if (null == IOuyaActivity.GetActivity()) { Log.e(TAG, "initOuyaPlugin: activity is null"); UnityPlayer.UnitySendMessage("OuyaGameObject", "OnFailureInitializePlugin", "Activity is missing"); return; }/*from w w w. ja va2 s . co m*/ if (null == IOuyaActivity.GetApplicationKey()) { Log.e(TAG, "initOuyaPlugin: application key is null"); UnityPlayer.UnitySendMessage("OuyaGameObject", "OnFailureInitializePlugin", "Application key is missing"); return; } Log.i(TAG, "initOuyaPlugin: Initializing plugin"); Bundle developerInfo = new Bundle(); developerInfo.putByteArray(OuyaFacade.OUYA_DEVELOPER_PUBLIC_KEY, IOuyaActivity.GetApplicationKey()); JSONArray jsonArray = new JSONArray(jsonData); for (int index = 0; index < jsonArray.length(); ++index) { JSONObject jsonObject = jsonArray.getJSONObject(index); String name = jsonObject.getString("key"); String value = jsonObject.getString("value"); if (null == name || null == value) { continue; } if (name.equals("tv.ouya.product_id_list")) { String[] productIds = value.split(","); if (null == productIds) { continue; } developerInfo.putStringArray("tv.ouya.product_id_list", productIds); } else { developerInfo.putString(name, value); } } UnityOuyaFacade unityOuyaFacade = new UnityOuyaFacade(IOuyaActivity.GetActivity(), IOuyaActivity.GetSavedInstanceState(), developerInfo); IOuyaActivity.SetUnityOuyaFacade(unityOuyaFacade); Log.i(TAG, "initOuyaPlugin: OuyaGameObject send OnSuccessInitializePlugin"); UnityPlayer.UnitySendMessage("OuyaGameObject", "OnSuccessInitializePlugin", ""); } catch (Exception e) { e.printStackTrace(); UnityPlayer.UnitySendMessage("OuyaGameObject", "OnFailureInitializePlugin", "InitializePlugin exception"); } } }; activity.runOnUiThread(runnable); } }
From source file:de.aw.monma.wertpapier.FragmentWertpapierUebersicht.java
@Override public void setCursorLoaderArguments(int id, Bundle args) { if (mAccountID != NOID) { selection += " AND " + column_accountID + " = ? "; selectionArgs = new String[] { mAccountID.toString() }; args.putStringArray(SELECTIONARGS, selectionArgs); }//from w w w. j a v a2 s . c o m args.putString(SELECTION, selection); }
From source file:com.fbbackup.ImageGridFragment.java
@TargetApi(16) @Override/*from w w w. j a v a 2 s . c o m*/ public void onItemClick(AdapterView<?> parent, View v, int position, long id) { final Intent i = new Intent(getActivity(), ImageDetailActivity.class); Bundle bundle = new Bundle(); bundle.putStringArray("photo", photoArray); bundle.putInt("albumPosition", position); bundle.putString("albumName", albumName); bundle.putString("userName", name); i.putExtras(bundle); i.putExtra(ImageDetailActivity.EXTRA_IMAGE, (int) id); if (Utils.hasJellyBean()) { // makeThumbnailScaleUpAnimation() looks kind of ugly here as the // loading spinner may // show plus the thumbnail image in GridView is cropped. so using // makeScaleUpAnimation() instead. ActivityOptions options = ActivityOptions.makeScaleUpAnimation(v, 0, 0, v.getWidth(), v.getHeight()); getActivity().startActivity(i, options.toBundle()); } else { startActivity(i); } }
From source file:org.eatabrick.vecna.Vecna.java
@Override public void onSaveInstanceState(Bundle savedInstanceState) { super.onSaveInstanceState(savedInstanceState); savedInstanceState.putString("passphrase", passphrase); savedInstanceState.putStringArray("entries", adapter.toStringArray()); }
From source file:com.github.michalbednarski.intentslab.providerlab.AdvancedQueryActivity.java
@Override protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putStringArray(EXTRA_PROJECTION, getProjection()); outState.putStringArray(EXTRA_SELECTION_ARGS, getSelectionArgs()); outState.putParcelable(EXTRA_CONTENT_VALUES, getContentValues()); }