List of usage examples for android.os Bundle Bundle
public Bundle()
From source file:org.klnusbaum.udj.auth.Authenticator.java
@Override public Bundle addAccount(AccountAuthenticatorResponse response, String accountType, String authTokenType, String[] requiredFeatures, Bundle options) { final Intent addIntent = new Intent(context, AuthActivity.class); addIntent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE, response); final Bundle addBundle = new Bundle(); addBundle.putParcelable(AccountManager.KEY_INTENT, addIntent); return addBundle; }
From source file:it.gulch.linuxday.android.fragments.TrackScheduleListFragment.java
public static TrackScheduleListFragment newInstance(Day day, Track track, long fromEventId) { Bundle args = new Bundle(); args.putSerializable(ARG_DAY, day);/*from w w w. j a va2s . c om*/ args.putSerializable(ARG_TRACK, track); args.putLong(ARG_FROM_EVENT_ID, fromEventId); TrackScheduleListFragment f = new TrackScheduleListFragment(); f.setArguments(args); return f; }
From source file:bolts.MeasurementEvent.java
/** * Broadcast Bolts measurement event./*w w w .ja va 2s .c o m*/ * Bolts raises events to the application with this method by sending * {@link #MEASUREMENT_EVENT_NOTIFICATION_NAME} broadcast. * * @param context the context of activity or application who is going to send the event. required. * @param name the event name that is going to be sent. required. * @param intent the intent that carries the logging data in its extra bundle and data url. optional. * @param extraLoggingData other logging data to be sent in events argument. optional. * */ static void sendBroadcastEvent(Context context, String name, Intent intent, Map<String, String> extraLoggingData) { Bundle logData = new Bundle(); if (intent != null) { Bundle applinkData = AppLinks.getAppLinkData(intent); if (applinkData != null) { logData = getApplinkLogData(context, name, applinkData, intent); } else { Uri intentUri = intent.getData(); if (intentUri != null) { logData.putString("intentData", intentUri.toString()); } Bundle intentExtras = intent.getExtras(); if (intentExtras != null) { for (String key : intentExtras.keySet()) { Object o = intentExtras.get(key); String logValue = objectToJSONString(o); logData.putString(key, logValue); } } } } if (extraLoggingData != null) { for (String key : extraLoggingData.keySet()) { logData.putString(key, extraLoggingData.get(key)); } } MeasurementEvent event = new MeasurementEvent(context, name, logData); event.sendBroadcast(); }
From source file:com.easy.facebook.android.apicall.FQL.java
public List<Friend> getFriends(String uids[]) throws EasyFacebookError { String whereClause = ""; List<Friend> friendList = new ArrayList<Friend>(); for (int i = 0; i < uids.length - 1; i++) whereClause = (new StringBuilder(String.valueOf(whereClause))).append("uid = ").append(uids[i]) .append(" OR ").toString(); whereClause = (new StringBuilder(String.valueOf(whereClause))).append("uid = ") .append(uids[uids.length - 1]).toString(); Bundle params = new Bundle(); params.putString("format", "json"); params.putString("access_token", facebook.getAccessToken()); params.putString("method", "fql.query"); String fqlQuery = (new StringBuilder( "SELECT uid, name, pic, profile_update_time, timezone, birthday_date, status, online_presence, locale, profile_url, website, is_blocked FROM user WHERE ")) .append(whereClause).toString(); params.putString("query", fqlQuery); String jsonResponse;/*from w w w . jav a2 s . c o m*/ try { jsonResponse = Util.openUrl("https://api.facebook.com/restserver.php", "POST", params); JSONObjectDecode jsonArray = new JSONObjectDecode(jsonResponse); for (int i = 0; i < jsonArray.length(); i++) friendList.add(jsonArray.getFriend(i)); } catch (MalformedURLException e) { throw new EasyFacebookError(e.toString(), "MalformedURLException"); } catch (IOException e) { throw new EasyFacebookError(e.toString(), "IOException"); } catch (JSONException e) { throw new EasyFacebookError(e.toString(), "JSONException"); } return friendList; }
From source file:com.easy.facebook.android.facebook.Facebook.java
public boolean sessionIsValid() { Bundle params = new Bundle(); params.putString("format", "json"); params.putString("access_token", getAccessToken()); String jsonResponse;/* w w w .j ava2 s .c om*/ try { jsonResponse = Util.openUrl("https://graph.facebook.com/me/feed", "GET", params); JSONObject objectJSON = new JSONObject(jsonResponse); if (!objectJSON.isNull("error")) { Log.e("EasyFacebookAndroid", "Invalid EasyFacebookAndroid session"); return false; } if (!objectJSON.isNull("data")) { return true; } else { Log.e("EasyFacebookAndroid", "Invalid EasyFacebookAndroid session"); return false; } } catch (MalformedURLException e) { Log.e("EasyFacebookAndroid", e.toString()); return false; } catch (IOException e) { Log.e("EasyFacebookAndroid", e.toString()); return false; } catch (JSONException e) { Log.e("EasyFacebookAndroid", e.toString()); return false; } }
From source file:com.prey.json.actions.Geofencing.java
public void stop(Context ctx, List<ActionResult> lista, JSONObject parameters) { Bundle bundle = new Bundle(); bundle.putInt("type", ProxAlertActivity.STOP); Intent popup = new Intent(ctx, ProxAlertActivity.class); popup.putExtras(bundle);//from www . j av a2s . c o m popup.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); ctx.startActivity(popup); PreyLogger.i("Finish Geofencing stop"); }
From source file:es.wolfi.app.passman.CredentialDisplay.java
/** * Use this factory method to create a new instance of * this fragment using the provided parameters. * * @param credentialGUID The guid of the credential to display. * @return A new instance of fragment CredentialDisplay. *//*from w ww . jav a 2 s. com*/ // TODO: Rename and change types and number of parameters public static CredentialDisplay newInstance(String credentialGUID) { CredentialDisplay fragment = new CredentialDisplay(); Bundle b = new Bundle(); b.putString(CREDENTIAL, credentialGUID); fragment.setArguments(b); return fragment; }
From source file:com.clearcenter.mobile_demo.mdAuthenticator.java
public Bundle addAccount(AccountAuthenticatorResponse response, String accountType, String authTokenType, String[] requiredFeatures, Bundle options) { Log.v(TAG, "addAccount()"); final Intent intent = new Intent(ctx, mdAuthenticatorActivity.class); 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.cph.chicago.fragment.BikeFragment.java
/** * Returns a new instance of this fragment for the given section number. * /*from w w w . jav a 2 s .c o m*/ * @param sectionNumber * the section number * @return the fragment */ public static BikeFragment newInstance(final int sectionNumber) { BikeFragment fragment = new BikeFragment(); Bundle args = new Bundle(); args.putInt(ARG_SECTION_NUMBER, sectionNumber); fragment.setArguments(args); return fragment; }
From source file:edu.cwru.apo.APO.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // removes title bar on app, making image full screen requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.splash_screen); // load keys if they exist Auth.loadKeys(getSharedPreferences(APO.PREF_FILE_NAME, MODE_PRIVATE)); API api = new API(this); if (!api.callMethod(Methods.checkCredentials, this, (String[]) null)) { Intent loginIntent = new Intent(APO.this, Login.class); Bundle extras = new Bundle(); extras.putString("msg", "No saved credentials"); loginIntent.putExtras(extras);/*from w w w . ja v a 2 s .c o m*/ APO.this.startActivity(loginIntent); finish(); } }