List of usage examples for android.os Bundle Bundle
public Bundle()
From source file:com.foxykeep.datadroidpoc.data.factory.CityListJsonFactory.java
public static Bundle parseResult(String wsResponse) throws DataException { ArrayList<City> cityList = new ArrayList<City>(); try {//from w w w .j av a 2s . c om JSONObject parser = new JSONObject(wsResponse); JSONObject jsonRoot = parser.getJSONObject(JSONTag.CITY_LIST_ELEM_CITIES); JSONArray jsonPersonArray = jsonRoot.getJSONArray(JSONTag.CITY_LIST_ELEM_CITY); int size = jsonPersonArray.length(); for (int i = 0; i < size; i++) { JSONObject jsonPerson = jsonPersonArray.getJSONObject(i); City city = new City(); city.name = jsonPerson.getString(JSONTag.CITY_LIST_ELEM_CITY_NAME); city.postalCode = jsonPerson.getString(JSONTag.CITY_LIST_ELEM_CITY_POSTAL_CODE); city.state = jsonPerson.getString(JSONTag.CITY_LIST_ELEM_CITY_STATE); city.country = jsonPerson.getString(JSONTag.CITY_LIST_ELEM_CITY_COUNTRY); cityList.add(city); } } catch (JSONException e) { Log.e(TAG, "JSONException", e); throw new DataException(e); } Bundle bundle = new Bundle(); bundle.putParcelableArrayList(PoCRequestFactory.BUNDLE_EXTRA_CITY_LIST, cityList); return bundle; }
From source file:com.royclarkson.springagram.PhotoAddFragment.java
public static PhotoAddFragment newInstance(String photosUrl) { PhotoAddFragment fragment = new PhotoAddFragment(); Bundle args = new Bundle(); args.putString(ARG_PHOTOS_LIST_URL, photosUrl); fragment.setArguments(args);/*from ww w . j av a2 s . com*/ return fragment; }
From source file:com.mikecorrigan.trainscorekeeper.FragmentSummary.java
public static FragmentSummary newInstance(int index, JSONObject jsonSpec) { Log.vc(VERBOSE, TAG, "newInstance: jsonTab=" + jsonSpec); FragmentSummary fragment = new FragmentSummary(); Bundle args = new Bundle(); args.putInt(ARG_INDEX, index);//from w ww. j a v a2 s . c o m args.putString(ARG_TAB_SPEC, jsonSpec.toString()); fragment.setArguments(args); return fragment; }
From source file:com.mdlive.myhealth.ProviderDetailsFragment.java
/** * Use this factory method to create a new instance of * this fragment.//from w w w . j a va 2 s. c om * * @return A new instance of fragment MDLiveMyHealthProvidersFragment. */ public static ProviderDetailsFragment newInstance(String providerId) { Bundle args = new Bundle(); args.putString(PROVIDER_TAG, providerId); ProviderDetailsFragment fragment = new ProviderDetailsFragment(); fragment.setArguments(args); return fragment; }
From source file:com.tedx.logics.AttendeeLogic.java
public static Bundle GetCurrentDancers(Resources res, String EventUniqueId) { String Action = "GetAttendeeByUniqueId"; JSONObject requestJSONParameters = new JSONObject(); try {/*from w ww.j a va 2s . com*/ requestJSONParameters.put("EventId", Integer.valueOf(res.getString(R.string.eventId))); requestJSONParameters.put("EventUniqueId", EventUniqueId); } catch (JSONException e) { // TODO Auto-generated catch block return null; } String URL = res.getString(R.string.WebServiceAddress) + Action; JSONObject responseJSON = WebServices.SendHttpPost(URL, requestJSONParameters); if (responseJSON != null) { try { if (responseJSON.getBoolean("IsSuccessful")) { Bundle ret = new Bundle(); ret.putInt("AttendeeId", responseJSON.getInt("AttendeeId")); ret.putString("FirstName", responseJSON.getString("FirstName")); ret.putString("LastName", responseJSON.getString("LastName")); ret.putString("ContactNumber", responseJSON.getString("ContactNumber")); ret.putString("Website", responseJSON.getString("Website")); ret.putString("Email", responseJSON.getString("Email")); ret.putString("Facebook", responseJSON.getString("Facebook")); ret.putString("Twitter", responseJSON.getString("Twitter")); ret.putString("Description", responseJSON.getString("Description")); return ret; } else return null; } catch (JSONException e) { // TODO Auto-generated catch block return null; } } else return null; }
From source file:it.scoppelletti.mobilepower.app.ProgressDialogFragment.java
/** * Istanzia un frammento./*from w w w . ja v a2 s.c om*/ * * @param titleId Identificatore della risorsa del titolo. * @param max Valore massimo dell’indice di avanzamento. Se * è minore o uguale a {@code 0}, l’indice * di avanzamento è indeterminato. * @param cancelable Indicatore di dialogo cancellabile. * @return Frammento. */ public static ProgressDialogFragment newInstance(int titleId, int max, boolean cancelable) { Bundle args; ProgressDialogFragment fragment; args = new Bundle(); args.putInt(ProgressDialogFragment.ARG_TITLEID, titleId); args.putInt(ProgressDialogFragment.ARG_MAX, max); args.putBoolean(ProgressDialogFragment.ARG_CANCELABLE, cancelable); fragment = new ProgressDialogFragment(); fragment.setArguments(args); fragment.setCancelable(cancelable); return fragment; }
From source file:com.prey.json.actions.Geofencing.java
public void start(Context ctx, List<ActionResult> lista, JSONObject parameters) { try {/*from w w w . ja va 2 s . c om*/ String origin = parameters.getString("origin"); String[] centralPoints = origin.split(","); String longitude = centralPoints[0]; String latitude = centralPoints[1]; String radius = parameters.getString("radius"); Bundle bundle = new Bundle(); bundle.putDouble("longitude", Double.parseDouble(longitude)); bundle.putDouble("latitude", Double.parseDouble(latitude)); bundle.putFloat("radius", Float.parseFloat(radius)); bundle.putInt("type", ProxAlertActivity.START); Intent popup = new Intent(ctx, ProxAlertActivity.class); popup.putExtras(bundle); popup.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); ctx.startActivity(popup); PreyLogger.i("Finish Geofencing start"); } catch (JSONException e) { PreyLogger.e("Error en json:" + e.getMessage(), e); PreyWebServices.getInstance().sendNotifyActionResultPreyHttp(ctx, UtilJson.makeMapParam("start", "geofence", "failed", e.getMessage())); } }
From source file:com.royclarkson.springagram.GalleryListFragment.java
public static GalleryListFragment newInstance(String galleriesUrl) { GalleryListFragment fragment = new GalleryListFragment(); Bundle args = new Bundle(); args.putString(ARG_GALLERIES_LIST_URL, galleriesUrl); fragment.setArguments(args);/*from ww w . j a v a 2 s . c o m*/ return fragment; }
From source file:com.manning.androidhacks.hack029.fragment.ColorFragment.java
public static ColorFragment newInstance(int color, String text, boolean isLandscape) { ColorFragment recreateFragment = new ColorFragment(); Bundle args = new Bundle(); args.putInt(COLOR_KEY, color);/* w w w . j ava2 s . c om*/ args.putString(TEXT_KEY, text); args.putBoolean(LANDSCAPE_KEY, isLandscape); recreateFragment.setArguments(args); return recreateFragment; }
From source file:com.phicomm.account.operator.GetMapOperation.java
@Override public Bundle execute(Context context, Request request) { String ssession_id = null;// w w w . ja va 2 s. com Bundle resultData = new Bundle(); Cursor persionCursor = context.getContentResolver().query(Provider.PersonColumns.CONTENT_URI, null, null, null, null); if (persionCursor != null) { if (persionCursor.moveToFirst()) { ssession_id = persionCursor .getString(persionCursor.getColumnIndex(Provider.PersonColumns.JSSESSIONID)); } persionCursor.close(); } String url = WSConfig.WS_GET_MAP_URL + ssession_id; NetworkConnection networkConnection1 = new NetworkConnection(context, url); ArrayList<BasicNameValuePair> parameterList = new ArrayList<BasicNameValuePair>(); BasicNameValuePair value = new BasicNameValuePair("XML", ""); parameterList.add(value); networkConnection1.setParameters(parameterList); try { ConnectionResult result = networkConnection1.execute(); resultData.putString("result", result.body); Log.i("ss", "map________________________________result.body:" + result.body); } catch (ConnectionException e) { e.printStackTrace(); } Log.i("ss", "_______________________________________OK"); return resultData; }