Bundle putParcelable - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Bundle putParcelable method.

This code example shows how to use the following methods:addAccount, putParcelable
        outState.putBoolean(KEY_ADD_CALLED, mAddAccountCalled);
        if (Log.isLoggable(TAG, Log.VERBOSE)) Log.v(TAG, "saved");
    } 
 
    private void addAccount(String accountType) {
        Bundle addAccountOptions = new Bundle();
        mPendingIntent = PendingIntent.getBroadcast(this, 0, new Intent(), 0);
        addAccountOptions.putParcelable(KEY_CALLER_IDENTITY, mPendingIntent);
        AccountManager.get(this).addAccount(
                accountType,
                null, /* authTokenType */ 
                null, /* requiredFeatures */ 
                addAccountOptions,
                this,
                mCallback,
                null /* handler */); 
        mAddAccountCalled  = true;
    } 
} 
7
CodeRank
This code example shows how to use the following methods:putParcelable
			String[] requiredFeatures, Bundle options)
			throws NetworkErrorException { 
		Intent intent = AccountAdd.createIntent(Application.getInstance());
		intent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE,
				response);
		Bundle bundle = new Bundle();
		bundle.putParcelable(AccountManager.KEY_INTENT, intent);
		return bundle;
	} 
 
	@Override 
	public Bundle confirmCredentials(AccountAuthenticatorResponse response,
			Account account, Bundle options) {
		return null; 
	} 
 
	@Override 
	public Bundle editProperties(AccountAuthenticatorResponse response,
			String accountType) {
		throw new UnsupportedOperationException();
7
CodeRank
This code example shows how to use the following methods:putParcelable
    } 
 
    public static SupportMapFragment newInstance(GoogleMapOptions options) {
        final SupportMapFragment f = new SupportMapFragment();
 
        final Bundle args = new Bundle();
        args.putParcelable(ARGS_OPTIONS, options);
        f.setArguments(args);
 
        return f;
    } 
 
    /** 
     * Gets the underlying GoogleMap that is tied to the view wrapped by this fragment. 
     * 
     * @return the underlying GoogleMap. Null if the view of the fragment is not yet ready. This can happen if the fragment lifecyle have 
     *         not gone through {@link #onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)} yet. This can 
     *         also happen if Google Play services is not available. If Google Play services becomes available afterwards and the fragment 
     *         have gone through {@link #onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)} , calling 
     *         this method again will initialize and return the GoogleMap. 
7
CodeRank
This code example shows how to use the following methods:putFloat, putParcelable
	/* (non-Javadoc) 
	 * @see android.view.View#onSaveInstanceState() 
	 */ 
	@Override 
	protected Parcelable onSaveInstanceState() {
		final Bundle bundle = new Bundle();
		bundle.putParcelable(INSTNACE_STATE_SAVEDSTATE, super.onSaveInstanceState());
		bundle.putFloat(INSTNACE_STATE_PROGRESS, mProgress);
		bundle.putFloat(INSTNACE_STATE_MARKER_PROGRESS, mMarkerProgress);
		return bundle;
	} 
 
	/** 
	 * Compute insets. 
	 * _______________________ 
	 * |_________dx/2_________| 
	 * |......|.�''''`.|......| 
	 * |-dx/2-|| View ||-dx/2-| 
	 * |______|`.____.�|______| 
	 * |________ dx/2_________| 
7
CodeRank
This code example shows how to use the following methods:putParcelable
    } 
 
    public static MapFragment newInstance(GoogleMapOptions options) {
        final MapFragment f = new MapFragment();
 
        final Bundle args = new Bundle();
        args.putParcelable(ARGS_OPTIONS, options);
        f.setArguments(args);
 
        return f;
    } 
 
    /** 
     * Gets the underlying GoogleMap that is tied to the view wrapped by this fragment. 
     * 
     * @return the underlying GoogleMap. Null if the view of the fragment is not yet ready. This can happen if the fragment lifecyle have 
     *         not gone through {@link #onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)} yet. This can 
     *         also happen if Google Play services is not available. If Google Play services becomes available afterwards and the fragment 
     *         have gone through {@link #onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)} , calling 
     *         this method again will initialize and return the GoogleMap. 
7
CodeRank
This code example shows how to use the following methods:putParcelable
			String authTokenType, String[] requiredFeatures, Bundle options) throws NetworkErrorException {
		 
		Intent intent = new Intent(context, LoginActivity.class);
        intent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE, response);
         
        Bundle bundle = new Bundle();
        bundle.putParcelable(AccountManager.KEY_INTENT, intent);
         
        return bundle;
	} 
 
	@Override 
	public Bundle confirmCredentials(AccountAuthenticatorResponse response, Account account, Bundle options) throws NetworkErrorException {
		return booleanResponse(true); 
	} 
 
	@Override 
	public Bundle editProperties(AccountAuthenticatorResponse response, String accountType) {
		throw new UnsupportedOperationException();
	} 
7
CodeRank
This code example shows how to use the following methods:putFloat, putParcelable
 
	@Override 
	protected Parcelable onSaveInstanceState() {
		Parcelable superState = super.onSaveInstanceState();
 
		Bundle state = new Bundle();
		state.putParcelable(STATE_PARENT, superState);
		state.putFloat(STATE_ANGLE, mAngle);
 
		return state;
	} 
 
	@Override 
	protected void onRestoreInstanceState(Parcelable state) {
		Bundle savedState = (Bundle) state;
 
		Parcelable superState = savedState.getParcelable(STATE_PARENT);
		super.onRestoreInstanceState(superState);
 
		mAngle = savedState.getFloat(STATE_ANGLE);
8
CodeRank
This code example shows how to use the following methods:putParcelable
    public Bundle addAccount(AccountAuthenticatorResponse response, String accountType,
            String authTokenType, String[] requiredFeatures, Bundle options) {
        Log.v(TAG, "addAccount()");
        final Intent intent = new Intent(mContext, AuthenticatorActivity.class);
        intent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE, response);
        final Bundle bundle = new Bundle();
        bundle.putParcelable(AccountManager.KEY_INTENT, intent);
        return bundle;
    } 
 
    @Override 
    public Bundle confirmCredentials(
            AccountAuthenticatorResponse response, Account account, Bundle options) {
        Log.v(TAG, "confirmCredentials()");
        return null; 
    } 
 
    @Override 
    public Bundle editProperties(AccountAuthenticatorResponse response, String accountType) {
        Log.v(TAG, "editProperties()");
6
CodeRank
This code example shows how to use the following methods:putInt, putParcelable
    } 
  } 
   
  @Override 
  public Parcelable onSaveInstanceState() {
    Bundle state=new Bundle();
     
    state.putParcelable(SUPERSTATE, super.onSaveInstanceState());
    state.putInt(COLOR, getColor());
 
    return(state);
  } 
 
  @Override 
  public void onRestoreInstanceState(Parcelable ss) {
    Bundle state=(Bundle)ss;
     
    super.onRestoreInstanceState(state.getParcelable(SUPERSTATE));
 
    setColor(state.getInt(COLOR));
8
CodeRank
This code example shows how to use the following methods:putAll, putParcelable
	/** 
	 * Converts an intent into a {@link Bundle} suitable for use as fragment 
	 * arguments. 
	 */ 
	public static Bundle intentToFragmentArguments(Intent intent) {
		Bundle arguments = new Bundle();
		if (intent == null) {
			return arguments;
		} 
 
		final Uri data = intent.getData();
		if (data != null) {
			arguments.putParcelable("_uri", data);
		} 
 
		final Bundle extras = intent.getExtras();
		if (extras != null) {
			arguments.putAll(intent.getExtras());
		} 
 

7
CodeRank

Related Bundle putParcelable Questions & Answers:

Other Bundle putParcelable Examples

120:			// save file url in bundle as it will be null on scren orientation
121:			// changes
122:			outState.putParcelable("file_uri", fileUri);
123:		}
124:

Read More

8:			// save file url in bundle as it will be null on scren orientation
9:			// changes
10:			outState.putParcelable("file_uri", fileUri);
11:		}
12:

Read More

putParcelable Method Overview
Inserts a Parcelable value into the mapping of this Bundle, replacing any existing value for the given key.
See Code Examples for other Android Bundle Methods: