List of usage examples for android.os Bundle Bundle
public Bundle()
From source file:com.hybris.mobile.app.commerce.CommerceApplicationBase.java
/** * Update the ContentServiceHelper and SyncAdapter url * * @param url//from ww w . j a va 2 s . c om * @param catalog * @param catalogId * @param catalogMainCategoryId */ public static void updateUrl(String url, String catalog, String catalogId, String catalogMainCategoryId) { // Cancelling all the requests first mInstance.mContentServiceHelper.cancelAll(); // For the catalog sync adapter Bundle bundle = new Bundle(); bundle.putBoolean(CatalogSyncConstants.SYNC_PARAM_CANCEL_ALL_REQUESTS, true); requestCatalogSyncAdapter(bundle); // Updating the configuration of the catalog sync adapter bundle = new Bundle(); bundle.putString(CatalogSyncConstants.SYNC_PARAM_CONTENT_SERVICE_HELPER_URL, url); bundle.putString(CatalogSyncConstants.SYNC_PARAM_CONTENT_SERVICE_HELPER_CATALOG, catalog); bundle.putString(CatalogSyncConstants.SYNC_PARAM_CONTENT_SERVICE_HELPER_CATALOG_ID, catalogId); bundle.putString(CatalogSyncConstants.SYNC_PARAM_CONTENT_SERVICE_HELPER_CATALOG_VERSION_ID, mInstance.getString(R.string.url_path_catalog_version_id)); bundle.putString(CatalogSyncConstants.SYNC_PARAM_CONTENT_SERVICE_HELPER_MAIN_CATEGORY_ID, catalogMainCategoryId); requestCatalogSyncAdapter(bundle); // Content service helper mInstance.mContentServiceHelper.updateConfiguration(url, catalog, catalogId, mInstance.getString(R.string.url_path_catalog_version_id), catalogMainCategoryId); }
From source file:com.joda.tentatime.FindExamActivity.java
private void setupWidgets() { Button btn = (Button) findViewById(R.id.searchB); btn.setOnClickListener(new View.OnClickListener() { @Override/*from ww w .j a va 2s .c om*/ public void onClick(View v) { DownloadJsonTask task = new DownloadJsonTask(); task.execute(userChoice(mGetExam.getText().toString())); } }); mGetExam = (EditText) findViewById(R.id.getExam); examsView = (ListView) findViewById(R.id.examsLV); examsView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Intent intent = new Intent(FindExamActivity.this, Result.class); Bundle b = new Bundle(); b.putSerializable("key", (Serializable) results.get(position)); intent.putExtras(b); //deliver the exam to the next Intent startActivityForResult(intent, 1); } }); // CAST THE LINEARLAYOUT HOLDING THE MAIN PROGRESS (SPINNER) //linlaHeaderProgress = (LinearLayout) findViewById(R.id.linlaHeaderProgress); }
From source file:edu.mit.mobile.android.locast.accounts.AbsLocastAuthenticator.java
/** * {@inheritDoc}//from w ww .ja v a2 s . c om */ @Override public Bundle addAccount(AccountAuthenticatorResponse response, String accountType, String authTokenType, String[] requiredFeatures, Bundle options) { final Intent intent = getAuthenticator(mContext); intent.putExtra(AbsLocastAuthenticatorActivity.EXTRA_AUTHTOKEN_TYPE, authTokenType); intent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE, response); final Bundle bundle = new Bundle(); bundle.putParcelable(AccountManager.KEY_INTENT, intent); return bundle; }
From source file:fr.unix_experience.owncloud_sms.authenticators.OwnCloudAuthenticator.java
@Override public Bundle addAccount(AccountAuthenticatorResponse response, String accountType, String authTokenType, String[] requiredFeatures, Bundle options) throws NetworkErrorException { final Bundle result; final Intent intent; intent = new Intent(_context, LoginActivity.class); result = new Bundle(); result.putParcelable(AccountManager.KEY_INTENT, intent); return result; }
From source file:cn.bidaround.ytcore.kaixin.KaixinUtil.java
/** * URL??key-value??//from w w w.j a v a 2s . c o m * * @param url * ?url * @return key-value?? */ public static Bundle parseUrl(String url) { url = url.replace("#", "?"); try { URL u = new URL(url); Bundle b = decodeUrl(u.getQuery()); Bundle ref = decodeUrl(u.getRef()); if (ref != null) b.putAll(ref); return b; } catch (MalformedURLException e) { return new Bundle(); } }
From source file:com.manning.androidhacks.hack023.MainActivity.java
public void refresh(View v) { Bundle extras = new Bundle(); extras.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true); Account account = ((HackApplication) getApplication()).getCurrentAccount(); if (ContentResolver.isSyncPending(account, TodoContentProvider.AUTHORITY)) { ContentResolver.cancelSync(account, TodoContentProvider.AUTHORITY); }// w ww .ja va 2s . c o m ContentResolver.requestSync(account, TodoContentProvider.AUTHORITY, extras); }
From source file:com.ztspeech.simutalk2.weibo.PostRecordTask.java
protected Integer doInBackground(Object... params) { /*/*from w w w . jav a2s . c o m*/ * if (params == null || params.length == 0 || params.length != 5) { * handler.sendEmptyMessage(Constant.RESULT_FAILED_ARG_ERR); return 0; } */ Kaixin kaixin = (Kaixin) params[0]; handler = (Handler) params[1]; String content = (String) params[2]; InputStream in = (InputStream) params[3]; try { // Bundle bundle = new Bundle(); bundle.putString("content", content); Map<String, Object> photoes = new HashMap<String, Object>(); photoes.put("filename", in); String jsonResult = kaixin.uploadContent(context, RESTAPI_INTERFACE_POSTRECORD, bundle, photoes); if (jsonResult == null) { handler.sendEmptyMessage(Constant.RESULT_FAILED_NETWORK_ERR); } else { KaixinError kaixinError = Util.parseRequestError(jsonResult); if (kaixinError != null) { Message msg = Message.obtain(); msg.what = Constant.RESULT_FAILED_REQUEST_ERR; msg.obj = kaixinError; handler.sendMessage(msg); } else { long rid = getRecordID(jsonResult); if (!isCancel) { if (rid > 0) { handler.sendEmptyMessage(Constant.RESULT_POST_RECORD_OK); } else { handler.sendEmptyMessage(Constant.RESULT_POST_RECORD_FAILED); } } else { handler.sendEmptyMessage(Constant.RESULT_USER_CANCEL_PROCESS); } } } } catch (MalformedURLException e1) { Log.e(TAG, "", e1); handler.sendEmptyMessage(Constant.RESULT_FAILED_MALFORMEDURL_ERR); } catch (IOException e1) { Log.e(TAG, "", e1); handler.sendEmptyMessage(Constant.RESULT_FAILED_NETWORK_ERR); } catch (Exception e1) { Log.e(TAG, "", e1); handler.sendEmptyMessage(Constant.RESULT_FAILED); } return 1; }
From source file:com.ronnyml.sweetplayer.fragments.SearchFragment.java
public static SearchFragment newInstance(int position, String screen) { SearchFragment fragment = new SearchFragment(); Bundle args = new Bundle(); args.putInt(Constants.POSITION, position); args.putString(Constants.SCREEN, screen); fragment.setArguments(args);/* w ww.j av a2 s .c o m*/ return fragment; }
From source file:com.miz.mizuu.fragments.RelatedMoviesFragment.java
public static RelatedMoviesFragment newInstance(String tmdbId, boolean setBackground, String json, String baseUrl) {/*w ww.j ava2 s. com*/ RelatedMoviesFragment pageFragment = new RelatedMoviesFragment(); Bundle bundle = new Bundle(); bundle.putString("tmdbId", tmdbId); bundle.putBoolean("setBackground", setBackground); bundle.putString("json", json); bundle.putString("baseUrl", baseUrl); pageFragment.setArguments(bundle); return pageFragment; }
From source file:mx.itdurango.rober.siitdocentes.asynctasks.ParcialesTask.java
@Override protected void onPostExecute(String resultado) { super.onPostExecute(resultado); Intent intent = new Intent(context, ActivityAlumnos.class); Bundle bundle = new Bundle(); bundle.putString("resultado", resultado); intent.putExtras(bundle);/*w w w . j a va 2 s. c o m*/ context.startActivity(intent); Estaticos.ringProgressDialog.dismiss(); }