List of usage examples for android.os Bundle putStringArray
public void putStringArray(@Nullable String key, @Nullable String[] value)
From source file:can.yrt.onebusaway.ArrivalsListFragment.java
private void showRoutesFilterDialog() { ObaArrivalInfoResponse response = getArrivalsLoader().getLastGoodResponse(); final List<ObaRoute> routes = response.getRoutes(mStop.getRouteIds()); final int len = routes.size(); final ArrayList<String> filter = mRoutesFilter; // mRouteIds = new ArrayList<String>(len); String[] items = new String[len]; boolean[] checks = new boolean[len]; // Go through all the stops, add them to the Ids and Names // For each stop, if it is in the enabled list, mark it as checked. for (int i = 0; i < len; ++i) { final ObaRoute route = routes.get(i); // final String id = route.getId(); // mRouteIds.add(i, id); items[i] = UIHelp.getRouteDisplayName(route); if (filter.contains(route.getId())) { checks[i] = true;/*from www. j a v a 2s. c o m*/ } } // Arguments Bundle args = new Bundle(); args.putStringArray(RoutesFilterDialog.ITEMS, items); args.putBooleanArray(RoutesFilterDialog.CHECKS, checks); RoutesFilterDialog frag = new RoutesFilterDialog(); frag.setArguments(args); frag.show(getActivity().getSupportFragmentManager(), ".RoutesFilterDialog"); }
From source file:it.angrydroids.epub3reader.MainActivity.java
public void chooseLanguage(int book) { String[] languages;/*from w w w . j a v a 2 s .c o m*/ languages = navigator.getLanguagesBook(book); if (languages.length == 2) refreshLanguages(book, 0, 1); else if (languages.length > 0) { Bundle bundle = new Bundle(); bundle.putInt(getString(R.string.tome), book); bundle.putStringArray(getString(R.string.lang), languages); LanguageChooser langChooser = new LanguageChooser(); langChooser.setArguments(bundle); langChooser.show(getFragmentManager(), ""); } else { errorMessage(getString(R.string.error_noOtherLanguages)); } }
From source file:com.example.emachine.FXcalcActivity.java
void showDialog(String title, List<String> moveItems, int noOfItems) { String[] dialogArr = new String[noOfItems]; for (int i = 0; i < noOfItems; i++) { dialogArr[i] = moveItems.get(i); }/*from w w w . j av a2 s . c o m*/ Bundle args = new Bundle(); args.putString(getString(R.string.str_alerttitle), title); args.putStringArray(getResources().getString(R.string.str_alertitems), dialogArr); AlertDialogFragment dialog = new AlertDialogFragment(); dialog.setArguments(args); dialog.show(getFragmentManager(), "Fields of green ?"); }
From source file:org.zywx.wbpalmstar.engine.universalex.EUExWidget.java
public void reloadWidgetByAppId(String[] params) { if (params.length < 1) { return;/* www . j ava2 s . c om*/ } Message msg = mHandler.obtainMessage(); msg.what = MSG_RELOAD_WIDGET_BY_APPID; msg.obj = this; Bundle bd = new Bundle(); bd.putStringArray(BUNDLE_DATA, params); msg.setData(bd); mHandler.sendMessage(msg); }
From source file:org.zywx.wbpalmstar.engine.universalex.EUExWidget.java
public void isAppInstalled(String[] params) { if (params == null || params.length < 1) { errorCallback(0, 0, "error params!"); return;// w w w .j a va2s . co m } Message msg = new Message(); msg.obj = this; msg.what = MSG_IS_APP_INSTALLED; Bundle bd = new Bundle(); bd.putStringArray(BUNDLE_DATA, params); msg.setData(bd); mHandler.sendMessage(msg); }
From source file:uk.org.rivernile.edinburghbustracker.android.fragments.general.BusStopMapFragment.java
/** * {@inheritDoc}/*from ww w . ja v a 2 s . c o m*/ */ @Override public void onSaveInstanceState(final Bundle outState) { super.onSaveInstanceState(outState); outState.putStringArray(ARG_CHOSEN_SERVICES, chosenServices); }
From source file:org.lyricue.android.Lyricue.java
@Override protected void onSaveInstanceState(Bundle outState) { for (String key : fragments.keySet()) { if (getSupportFragmentManager() != null) { if (fragments.get(key) != null) { getSupportFragmentManager().putFragment(outState, key, fragments.get(key)); }/* w w w . j ava 2 s. co m*/ } } outState.putParcelableArray("hosts", hosts); outState.putString("profile", profile); outState.putLong("playlistid", playlistid); outState.putStringArray("playlists_text", playlists_text); outState.putLongArray("playlists_id", playlists_id); outState.putStringArray("bibles_text", bibles_text); outState.putStringArray("bibles_id", bibles_id); outState.putStringArray("bibles_type", bibles_type); super.onSaveInstanceState(outState); }
From source file:com.github.gorbin.asne.instagram.InstagramSocialNetwork.java
/** * Request ArrayList of {@link com.github.gorbin.asne.core.persons.SocialPerson} by array of userIds * @param userID array of Instagram users id * @param onRequestSocialPersonsCompleteListener listener for array of {@link com.github.gorbin.asne.core.persons.SocialPerson} request */// ww w. j a va2 s . c om @Override public void requestSocialPersons(String[] userID, OnRequestSocialPersonsCompleteListener onRequestSocialPersonsCompleteListener) { super.requestSocialPersons(userID, onRequestSocialPersonsCompleteListener); Bundle args = new Bundle(); args.putStringArray(RequestSocialPersonsAsyncTask.PARAM_USER_ID, userID); executeRequest(new RequestSocialPersonsAsyncTask(), args, REQUEST_GET_PERSONS); }
From source file:com.fbbackup.FriendAlbumList.java
@TargetApi(16) @Override//from w w w . jav a2 s.co m public void onItemClick(AdapterView<?> parent, View v, int position, long id) { // TODO Auto-generated method stub downloadAlbumPhotoList = new ArrayList<String>(); downloadAlbumNameList = new ArrayList<String>(); downloadAlbumPhotoCountList = new ArrayList<Integer>(); getAlbumPhotoUrl(albumArray[position]); // final Intent i = new Intent(getActivity(), ImageGridActivity.class); Bundle bundle = new Bundle(); bundle.putStringArray("albumPhoto", albumPhotoUrlArray); bundle.putString("albumName", albumNameArray[position]); bundle.putString("userName", name); Log.w("downloadpic", "FriendAlbumList albumName:" + albumNameArray[position]); // i.putExtras(bundle); Fragment newFragment = new ImageGridFragment(); newFragment.setArguments(bundle); final FragmentTransaction ft = getFragmentManager().beginTransaction(); ft.replace(R.id.rl_user_photo, newFragment, "first"); ft.addToBackStack(null); ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN); ft.commit(); }
From source file:uk.org.rivernile.edinburghbustracker.android.fragments.general.BusStopMapFragment.java
/** * {@inheritDoc}/*from w w w . j a va 2s . com*/ */ @Override public void onServicesChosen(final String[] chosenServices) { this.chosenServices = chosenServices; // If the user has chosen services in the services filter, force a // refresh of the marker icons. refreshBusStops(null); final LinkedList<String> tempList = new LinkedList<String>(); boolean found; // Loop through the existing route lines. If a service doesn't exist in // the chosen services list, add it to the to-be-removed list. for (String key : routeLines.keySet()) { found = false; for (String fs : chosenServices) { if (key.equals(fs)) { found = true; break; } } if (!found) { tempList.add(key); } } LinkedList<Polyline> polyLines; // Loop through the to-be-removed list and remove the Polylines and the // entry from the routeLines HashMap. for (String toRemove : tempList) { polyLines = routeLines.get(toRemove); routeLines.remove(toRemove); for (Polyline pl : polyLines) { pl.remove(); } } // The tempList is going to be reused, so clear it out. tempList.clear(); // Loop through the filteredServices array. If the element does not // appear in the existing route lines, then add it to the to-be-added // list. for (String fs : chosenServices) { if (!routeLines.containsKey(fs)) { tempList.add(fs); } } final int size = tempList.size(); // Execute the load if there are routes to be loaded. if (size > 0) { final String[] servicesToLoad = new String[size]; tempList.toArray(servicesToLoad); final Bundle b = new Bundle(); b.putStringArray(LOADER_ARG_FILTERED_SERVICES, servicesToLoad); getLoaderManager().restartLoader(LOADER_ID_ROUTE_LINES, b, this); } }