Java Code Examples for android.os.Bundle.putParcelableArrayList()

The following are Jave code examples for showing how to use putParcelableArrayList() of the android.os.Bundle class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: Orin   File: DeleteSongsDialog.java   Source Code and License Vote up 6 votes
@NonNull
public static DeleteSongsDialog create(ArrayList<Song> songs) {
    DeleteSongsDialog dialog = new DeleteSongsDialog();
    Bundle args = new Bundle();
    args.putParcelableArrayList("songs", songs);
    dialog.setArguments(args);
    return dialog;
}
 
Example 2
Project: Shared-Route   File: ConfirmTaskActivity.java   Source Code and License Vote up 6 votes
@Override
protected void onPostExecute(final ArrayList<Integer> integers) {
    ArrayList<listItem> failList = new ArrayList<listItem>();
    ArrayList<listItem> successList = new ArrayList<listItem>();
    for (listItem e:itemlists){
        if (integers.contains(e.ID)) failList.add(e);
        else successList.add(e);
    }
    mAuthTask = null;
    //showProgress(false);
    Intent intent =new Intent(ConfirmTaskActivity.this,ConfirmFinishedActivity.class);
    itemlists = adapter.getItems();
    Bundle bundle = new Bundle();
    bundle.putParcelableArrayList("successList",successList);
    bundle.putParcelableArrayList("failList",failList);
    intent.putExtras(bundle);
    startActivity(intent);
    finish();
}
 
Example 3
Project: Phoenix-for-VK   File: PhotoPagerFragment.java   Source Code and License Vote up 6 votes
public static Bundle buildArgsForFave(int aid, @NonNull ArrayList<Photo> photos, int index) {
    Bundle args = new Bundle();
    args.putInt(Extra.ACCOUNT_ID, aid);
    args.putParcelableArrayList(EXTRA_PHOTOS, photos);
    args.putInt(Extra.INDEX, index);
    return args;
}
 
Example 4
Project: Protein   File: ShotListPresenter.java   Source Code and License Vote up 5 votes
@Override
public void onSaveInstanceState(Bundle outState) {
    outState.putInt(STATE_TYPE, type);
    if (firstPageShots.size() > 0) {
        outState.putParcelableArrayList(STATE_FIRST_PAGE_DATA, (ArrayList<? extends Parcelable>) firstPageShots);
    }
    outState.putString(STATE_NEXT_PAGE_URL, getNextPageUrl());
}
 
Example 5
Project: nongbeer-mvp-android-demo   File: MainActivity.java   Source Code and License Vote up 5 votes
@Override
protected void onSaveInstanceState( Bundle outState ){
    super.onSaveInstanceState( outState );
    List<BaseItem> items = cartAdapter.getItems();
    outState.putParcelableArrayList( KEY_BEER_ITEM_IN_CART, (ArrayList<? extends Parcelable>) items );
}
 
Example 6
Project: MovieApp   File: PeopleFullCreditViewPagerFragment.java   Source Code and License Vote up 5 votes
public static PeopleFullCreditViewPagerFragment newInstance(@Nullable ArrayList<Cast> castList,
                                                            @Nullable ArrayList<Crew> crewList,
                                                            Integer viewType) {

    Bundle args = new Bundle();

    args.putParcelableArrayList(ARG_CAST_LIST, castList);
    args.putParcelableArrayList(ARG_CREW_LIST, crewList);
    args.putInt(ARG_VIEW_TYPE, viewType);

    PeopleFullCreditViewPagerFragment fragment = new PeopleFullCreditViewPagerFragment();
    fragment.setArguments(args);
    return fragment;
}
 
Example 7
Project: boohee_v5.6   File: SportCourseFragment.java   Source Code and License Vote up 5 votes
public static SportCourseFragment newInstance(ArrayList<CourseItemInfo> data) {
    SportCourseFragment instance = new SportCourseFragment();
    Bundle bundle = new Bundle();
    bundle.putParcelableArrayList(KEY_COURSE_DATA, data);
    instance.setArguments(bundle);
    return instance;
}
 
Example 8
Project: anitrend-app   File: ProgressFragment.java   Source Code and License Vote up 5 votes
@Override
public void onSaveInstanceState(Bundle outState) {
    //outState.putParcelable(VIEW_PARCABLE, recyclerView.onSaveInstanceState());
    outState.putString(MODEL_TYPE, model_type);
    if(mData != null && mData.size() < 5) {
        outState.putInt(MODEL_PAGE, mPage);
        outState.putBoolean(MODEL_LIMIT, isLimit);
        outState.putParcelableArrayList(MODEL_CACHE, (ArrayList<? extends Parcelable>) mData);
    }
    super.onSaveInstanceState(outState);
}
 
Example 9
Project: TFG-SmartU-La-red-social   File: FragmentProyectos.java   Source Code and License Vote up 5 votes
/**
 * Usar este constructor para crear una instancia de
 * este fragment con parĂ¡metros
 *
 * @param proyectos Parametro 1.
 * @return A devuelve una nueva instancia del fragment.
 */
public static FragmentProyectos newInstance(ArrayList<Proyecto> proyectos,boolean filtro) {
    FragmentProyectos fragment = new FragmentProyectos();
    Bundle args = new Bundle();
    args.putParcelableArrayList(ARG_PROYECTOS, proyectos);
    args.putBoolean(ARG_FILTRO,filtro);
    fragment.setArguments(args);
    return fragment;
}
 
Example 10
Project: garras   File: Bundler.java   Source Code and License Vote up 5 votes
public Bundler putParcelableArrayList(@NonNull String key, ArrayList<? extends Parcelable> value) {
    Bundle safeBundle = new Bundle();
    safeBundle.putParcelableArrayList(key, value);
    if (isValidBundleSize(safeBundle)) {
        bundle.putParcelableArrayList(key, value);
    }
    clearBundle(safeBundle);
    return this;
}
 
Example 11
Project: GitJourney   File: FetchAddressIntentService.java   Source Code and License Vote up 5 votes
@Override
protected void onHandleIntent(@Nullable Intent intent) {
    Log.v(TAG, "onHandleIntent");
    Geocoder geocoder = new Geocoder(this, Locale.getDefault());
    String errorMessage = "";
    // Get the location passed to this service through an extra.
    ArrayList<GitHubUserLocationDataEntry> locationsList = intent.getParcelableArrayListExtra(
            LocationConstants.LOCATION_DATA_EXTRA);
    ResultReceiver mReceiver = intent.getParcelableExtra(
            LocationConstants.RECEIVER);
    try {
        for (int i = 0; i < locationsList.size(); i++) {
            GitHubUserLocationDataEntry entry = locationsList.get(i);
            List<Address> addressList = geocoder.getFromLocationName(entry.getLocation(), 1);
            if (!addressList.isEmpty()) {
                Address address = addressList.get(0);
                entry.setLatitude(address.getLatitude());
                entry.setLongitude(address.getLongitude());
            }
        }
    } catch (IOException ioException) {
        // Catch network or other I/O problems.
        errorMessage = getString(R.string.service_not_available);
        Log.e(TAG, errorMessage, ioException);
    } catch (IllegalArgumentException illegalArgumentException) {
        // Catch invalid latitude or longitude values.
        errorMessage = getString(R.string.invalid_lat_long_used);
        Log.e(TAG, errorMessage, illegalArgumentException);
    }
    Bundle bundle = new Bundle();
    bundle.putParcelableArrayList(LocationConstants.LOCATION_DATA_EXTRA, locationsList);
    mReceiver.send(0, bundle);
}
 
Example 12
Project: smart-device-cloud   File: MainActivity.java   Source Code and License Vote up 5 votes
@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putBoolean(KEY_IMAGE_ROTATION, image_rotation);
    outState.putInt(KEY_CAMERA, camera_id);
    outState.putString(KEY_ACCOUNT_ID, account_id);
    outState.putString(KEY_DEVICE_ID, device_id);
    outState.putString(KEY_SMART_DATA, smart_data);
    outState.putString(KEY_SMART_IMAGE, currentImageUrl);
    outState.putParcelableArrayList(KEY_SMART_LABELS, smart_labels);
}
 
Example 13
Project: TFG-SmartU-La-red-social   File: FragmentComentarios.java   Source Code and License Vote up 5 votes
/**
 * Usar este constructor para crear una instancia de
 * este fragment con parĂ¡metros
 *
 * @param comentarios Parametro 1.
 * @return A devuelve una nueva instancia del fragment.
 */
public static FragmentComentarios newInstance(ArrayList<Comentario> comentarios,boolean filtro) {
    FragmentComentarios fragment = new FragmentComentarios();
    Bundle args = new Bundle();
    args.putParcelableArrayList(ARG_COMENTARIOS, comentarios);
    args.putBoolean(ARG_FILTRO,filtro);
    fragment.setArguments(args);
    return fragment;
}
 
Example 14
Project: anitrend-app   File: UserReplyActivity.java   Source Code and License Vote up 5 votes
@Override
public void onSaveInstanceState(Bundle outState) {
    if(mInputEditText != null)
        outState.putString(MODEL_REPLY_TEXT, mInputEditText.getText().toString());
    outState.putBoolean(MODEL_IS_FAVOURITE, mPresentLike);
    outState.putInt(MODEL_KEY_PARAM, mModelLookUpKey);
    outState.putParcelable(MODEL_OBJ_PARAM, mPassedData);
    outState.putParcelableArrayList(MODEL_DATA_COLLECTION, (ArrayList<? extends Parcelable>) mData);
    super.onSaveInstanceState(outState);
}
 
Example 15
Project: boxing   File: BoxingViewActivity.java   Source Code and License Vote up 5 votes
@Override
protected void onSaveInstanceState(Bundle outState) {
    if (mSelectedImages != null) {
        outState.putParcelableArrayList(Boxing.EXTRA_SELECTED_MEDIA, mSelectedImages);
    }
    outState.putString(Boxing.EXTRA_ALBUM_ID, mAlbumId);
    super.onSaveInstanceState(outState);
}
 
Example 16
Project: Flubber   File: MainPanelFragment.java   Source Code and License Vote up 5 votes
@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);

    final ArrayList<Bundle> animationBundles =
            Stream.of(adapter.getData())
                    .map(Utils::createAnimationBodyBundle)
                    .collect(Collectors.toCollection(ArrayList::new));

    outState.putParcelableArrayList(BUNDLE_ANIMATION_BODIES, animationBundles);
}
 
Example 17
Project: q-mail   File: AttachmentPresenter.java   Source Code and License Vote up 4 votes
public void onSaveInstanceState(Bundle outState) {
    outState.putString(STATE_KEY_WAITING_FOR_ATTACHMENTS, actionToPerformAfterWaiting.name());
    outState.putParcelableArrayList(STATE_KEY_ATTACHMENTS, createAttachmentList());
    outState.putInt(STATE_KEY_NEXT_LOADER_ID, nextLoaderId);
}
 
Example 18
Project: boohee_v5.6   File: NotificationCompat.java   Source Code and License Vote up 4 votes
public Builder extend(Builder builder) {
    Bundle wearableBundle = new Bundle();
    if (!this.mActions.isEmpty()) {
        wearableBundle.putParcelableArrayList(KEY_ACTIONS, NotificationCompat.IMPL.getParcelableArrayListForActions((Action[]) this.mActions.toArray(new Action[this.mActions.size()])));
    }
    if (this.mFlags != 1) {
        wearableBundle.putInt(KEY_FLAGS, this.mFlags);
    }
    if (this.mDisplayIntent != null) {
        wearableBundle.putParcelable(KEY_DISPLAY_INTENT, this.mDisplayIntent);
    }
    if (!this.mPages.isEmpty()) {
        wearableBundle.putParcelableArray(KEY_PAGES, (Parcelable[]) this.mPages.toArray(new Notification[this.mPages.size()]));
    }
    if (this.mBackground != null) {
        wearableBundle.putParcelable(KEY_BACKGROUND, this.mBackground);
    }
    if (this.mContentIcon != 0) {
        wearableBundle.putInt(KEY_CONTENT_ICON, this.mContentIcon);
    }
    if (this.mContentIconGravity != 8388613) {
        wearableBundle.putInt(KEY_CONTENT_ICON_GRAVITY, this.mContentIconGravity);
    }
    if (this.mContentActionIndex != -1) {
        wearableBundle.putInt(KEY_CONTENT_ACTION_INDEX, this.mContentActionIndex);
    }
    if (this.mCustomSizePreset != 0) {
        wearableBundle.putInt(KEY_CUSTOM_SIZE_PRESET, this.mCustomSizePreset);
    }
    if (this.mCustomContentHeight != 0) {
        wearableBundle.putInt(KEY_CUSTOM_CONTENT_HEIGHT, this.mCustomContentHeight);
    }
    if (this.mGravity != 80) {
        wearableBundle.putInt(KEY_GRAVITY, this.mGravity);
    }
    if (this.mHintScreenTimeout != 0) {
        wearableBundle.putInt(KEY_HINT_SCREEN_TIMEOUT, this.mHintScreenTimeout);
    }
    builder.getExtras().putBundle(EXTRA_WEARABLE_EXTENSIONS, wearableBundle);
    return builder;
}
 
Example 19
Project: Inflix   File: UserReviewsFragment.java   Source Code and License Vote up 4 votes
@Override
public void onSaveInstanceState(@NonNull Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putLong(RESOURCE_ID, mResourceId);
    outState.putParcelableArrayList(MOVIE_REVIEWS, (ArrayList<? extends Parcelable>) mReviewsList);
}
 
Example 20
Project: GitHub   File: AbsBoxingViewFragment.java   Source Code and License Vote up 2 votes
/**
 * in {@link BoxingConfig.Mode#MULTI_IMG}, call this in {@link Fragment#onSaveInstanceState(Bundle)}.
 *
 * @param outState Bundle in which to place your saved state.
 * @param selected the selected medias.
 */
public final void onSaveMedias(Bundle outState, ArrayList<BaseMedia> selected) {
    if (selected != null && !selected.isEmpty()) {
        outState.putParcelableArrayList(Boxing.EXTRA_SELECTED_MEDIA, selected);
    }
}