public void testRestoreFromBundleTooManyConversationId() {
    Bundle bundle = new Bundle();

    ArrayList<Conversation> conversations = new ArrayList<Conversation>(TWELVE);
    ArrayList<ConversationId> conversationIds = new ArrayList<ConversationId>(TWELVE + 1);

    bundle.putParcelableArrayList(CONVERSATION_ID, conversationIds);
    bundle.putParcelableArrayList(CONVERSATION, conversations);

    mDialogueData.restoreFromBundle(bundle);

    // nothing should happen
  }
Пример #2
1
 @Override
 protected Bundle doInBackground(Bundle... params) {
   Bundle result = new Bundle();
   try {
     PagableResponseList<User> friends; // = new PagableResponseList<User>();
     long cursor = -1;
     long userID = mSharedPreferences.getLong(SAVE_STATE_KEY_USER_ID, -1);
     ArrayList<String> friendIds = new ArrayList<String>();
     ArrayList<SocialPerson> socialPersons = new ArrayList<SocialPerson>();
     SocialPerson socialPerson = new SocialPerson();
     do {
       friends = mTwitter.getFriendsList(userID, cursor);
       for (User user : friends) {
         friendIds.add(String.valueOf(user.getId()));
         getSocialPerson(socialPerson, user);
         socialPersons.add(socialPerson);
         socialPerson = new SocialPerson();
       }
     } while ((cursor = friends.getNextCursor()) != 0);
     result.putStringArray(
         RESULT_GET_FRIENDS_ID, friendIds.toArray(new String[friendIds.size()]));
     result.putParcelableArrayList(RESULT_GET_FRIENDS, socialPersons);
   } catch (TwitterException e) {
     result.putString(RESULT_ERROR, e.getMessage());
   }
   return result;
 }
 @Override
 public void onSaveInstanceState(Bundle outState) {
   super.onSaveInstanceState(outState);
   outState.putParcelableArrayList(STATE_LIST, getListAdapter().getList());
   outState.putParcelableArrayList(
       STATE_CAB_CHECKED_ITEMS, new ArrayList<Parcelable>(mCheckedItems));
 }
Пример #4
0
 @Override
 public void onSaveInstanceState(Bundle outState) {
   outState.putParcelableArrayList("allTapItem", allTapItem);
   outState.putParcelableArrayList("allToiletItem", allToiletItem);
   outState.putParcelableArrayList("allFoodItem", allFoodItem);
   super.onSaveInstanceState(outState);
 }
 @Override
 protected void onSaveInstanceState(Bundle outState) {
   super.onSaveInstanceState(outState);
   DataToSaveImagesVehicles data = new DataToSaveImagesVehicles(imagesMap);
   outState.putParcelable("map", data);
   outState.putParcelableArrayList("arrayList", imageVehicles);
   outState.putInt("orientation", orientation);
   outState.putParcelableArrayList("options", vehicleOptions);
   outState.putParcelable("currentVehicle", currentVehicle);
 }
 public static CompetedTestFragment instanceFragment(ArrayList<QuestionAnswer> questionAnswers) {
   CompetedTestFragment competedTestFragment = new CompetedTestFragment();
   Bundle bundle = new Bundle();
   bundle.putParcelableArrayList(QUESTIONS_ANSWERS, questionAnswers);
   competedTestFragment.setArguments(bundle);
   return competedTestFragment;
 }
Пример #7
0
 @Override
 public void onSaveInstanceState(Bundle outState) {
   super.onSaveInstanceState(outState);
   outState.putParcelableArrayList(FLICKS_DETAILS_LIST_KEY, mFlicksInitDetails);
   outState.putBoolean(ALERT_CANCELLED_KEY, mAlertCancelledState);
   outState.putBoolean(REQUEST_POSTED_KEY, mActivityLaunchPost);
 }
Пример #8
0
 public static ImageGridListFragment newInstance(List<Image> imageList) {
   ImageGridListFragment fragment = new ImageGridListFragment();
   Bundle args = new Bundle();
   args.putParcelableArrayList(IMAGE_LIST_KEY, (ArrayList) imageList);
   fragment.setArguments(args);
   return fragment;
 }
  @Override
  public void onSaveInstanceState(Bundle outState) {

    super.onSaveInstanceState(outState);
    outState.putParcelableArrayList(
        "transactions", (ArrayList<? extends Parcelable>) transactionList);
  }
    @Override
    public Fragment getItem(int position) {

      boolean isFromBucket =
          (getIntent() != null && (getIntent().getBooleanExtra("isFromBucket", false)));

      String title = mTabTitles.get(position);
      if (title.equalsIgnoreCase(getString(R.string.image))) {
        mImageFragment = new ImageFragment();

        Bundle bundle = new Bundle();
        if (isFromBucket) {
          bundle.putString("name", getIntent().getStringExtra("name"));
        }
        if (mCurrentSelectedImages != null) {
          bundle.putParcelableArrayList("selectedImages", mCurrentSelectedImages);
        }
        mImageFragment.setArguments(bundle);

        return mImageFragment;
      } else if (title.equalsIgnoreCase(getString(R.string.video))) {
        return getVideoFragment();
      } else {
        return null;
      }
    }
  @Override
  public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);

    outState.putParcelableArrayList(Score.class.getName(), (ArrayList) mScores);
    outState.putString(Constants.Extra.MATCH_DATE, mDate);
  }
 public static DoubleDatePickerDialogFragment newInstance(ArrayList<UTClass> classList) {
   DoubleDatePickerDialogFragment ddpdf = new DoubleDatePickerDialogFragment();
   Bundle args = new Bundle();
   args.putParcelableArrayList("classList", classList);
   ddpdf.setArguments(args);
   return ddpdf;
 }
Пример #13
0
 /**
  * Attaches value to the Node. Value types can be String or org.androidanalyzer.core.Data, if
  * other type is given an exception is raised. When value is Data type the method automatically
  * generates ArrayList<Data> to which the Data object is appended. This array list is returned on
  * getValue(). For String value dafault values are set for
  * ValueType(Constants.NODE_VALUE_TYPE_STRING),
  * Status(Constants.NODE_STATUS_OK),InputSource(Constants. NODE_INPUT_SOURCE_AUTOMATIC) and and
  * ConfirmationLevel(Constants .NODE_CONFIRMATION_LEVEL_TEST_CASE_CONFIRMED). For Data value the
  * dafault values are ValueType(Constants.NODE_VALUE_TYPE_DATA),
  * Status(Constants.NODE_STATUS_OK),InputSource(Constants. NODE_INPUT_SOURCE_AUTOMATIC) and and
  * ConfirmationLevel(Constants .NODE_CONFIRMATION_LEVEL_TEST_CASE_CONFIRMED).
  *
  * @param value - value to be attached to the Node
  */
 public void setValue(Object value) throws Exception {
   if (value != null) {
     if (value instanceof String) {
       bundle.putString(Constants.NODE_VALUE, (String) value);
       setValueType(Constants.NODE_VALUE_TYPE_STRING);
       setStatus(Constants.NODE_STATUS_OK);
       setInputSource(Constants.NODE_INPUT_SOURCE_AUTOMATIC);
       setConfirmationLevel(Constants.NODE_CONFIRMATION_LEVEL_TEST_CASE_CONFIRMED);
     } else if (value instanceof Data) {
       if (((Data) value).getValue() != null) {
         Data data = (Data) value;
         setValueType(Constants.NODE_VALUE_TYPE_DATA);
         setStatus(Constants.NODE_STATUS_OK);
         setInputSource(Constants.NODE_INPUT_SOURCE_AUTOMATIC);
         setConfirmationLevel(Constants.NODE_CONFIRMATION_LEVEL_TEST_CASE_CONFIRMED);
         Object temp = bundle.get(Constants.NODE_VALUE);
         ArrayList<Parcelable> list = null;
         if (temp instanceof ArrayList<?>) {
           list = (ArrayList<Parcelable>) temp;
         }
         if (list == null) {
           list = new ArrayList<Parcelable>();
         }
         list.add(data);
         bundle.putParcelableArrayList(Constants.NODE_VALUE, list);
       } else {
         throw new Exception(Constants.NO_VALUE_IN_DATA_OBJECT);
       }
     } else {
       throw new Exception(Constants.VALUE_TYPE_INCORRECT);
     }
   } else {
     throw new Exception(Constants.VALUE_NULL);
   }
 }
 @Override
 public void onSaveInstanceState(Bundle outState) {
   outState.putBoolean(EXTRA_KEYBOARD_HIDDEN, isKeyboardHidden);
   outState.putParcelableArrayList(
       EXTRA_PLACES_CONTENT, (ArrayList<? extends android.os.Parcelable>) placesFromServer);
   super.onSaveInstanceState(outState);
 }
 @Override
 public void onSaveInstanceState(final Bundle outState) {
   if (mData != null) {
     outState.putParcelableArrayList(INTENT_KEY_DATA, new ArrayList<ParcelableStatus>(mData));
   }
   super.onSaveInstanceState(outState);
 }
  @Override
  public void playTrack(ArrayList<Track> trackList, int selectedTrack) {

    if (mTwoPane) {

      // Create the fragment and show it as a dialog
      PlaybackFragment playbackFragment = new PlaybackFragment();

      Bundle b = new Bundle();
      b.putString(Utils.ARTIST_NAME, mArtistName);
      b.putParcelableArrayList(Utils.TRACK_LIST, trackList);
      b.putInt(Utils.SELECTED_TRACK_POSITION, selectedTrack);

      playbackFragment.setArguments(b);

      playbackFragment.show(getSupportFragmentManager(), PLAYBACK_FRAGMENT_TAG);

    } else {

      Intent playbackIntent = new Intent(MainActivity.this, PlaybackActivity.class);
      playbackIntent.putParcelableArrayListExtra(Utils.TRACK_LIST, trackList);
      playbackIntent.putExtra(Utils.SELECTED_TRACK_POSITION, selectedTrack);
      playbackIntent.putExtra(Utils.ARTIST_NAME, mArtistName);
      startActivity(playbackIntent);
    }
  }
Пример #17
0
 /**
  * Add extended data to the extra.
  *
  * @param name The name of the extra data, with package prefix.
  * @param value The ArrayList<Parcelable> data value.
  * @return Returns the same extra object, for chaining multiple calls into a single statement.
  * @see #putExtras
  * @see #removeExtra
  * @see #getParcelableArrayListExtra(String)
  */
 public Request putParcelableArrayListExtra(String name, ArrayList<? extends Parcelable> value) {
   if (mExtras == null) {
     mExtras = new Bundle();
   }
   mExtras.putParcelableArrayList(name, value);
   return this;
 }
Пример #18
0
 @Override
 protected void onSaveInstanceState(final Bundle out) {
   out.putParcelableArrayList(STATE_BUGOVERLAYITEMS_ID, this.mBugOverlayItems);
   out.putInt(STATE_BUGOVERLAYITEMS_SELECTED_ID, this.mBugOverlayItemsIndex);
   out.putInt(STATE_ZOOMLEVEL_ID, super.mOSMapView.getZoomLevel());
   out.putParcelable(STATE_ADDOSMPOITYPE_ID, this.mAddOSMPOIType);
   out.putParcelable(STATE_MAPCENTER_ID, super.mOSMapView.getMapCenter());
 }
Пример #19
0
 public static NewPostFragment newInstance(ArrayList<Parcelable> images, String mime) {
   NewPostFragment fragment = new NewPostFragment();
   Bundle args = new Bundle();
   args.putParcelableArrayList(ARG_IMAGES, images);
   args.putString(ARG_MIME, mime);
   fragment.setArguments(args);
   return fragment;
 }
Пример #20
0
  @Override
  public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);

    if (mAdapter != null && !mAdapter.isEmpty()) {
      outState.putParcelableArrayList(KEY_SAVED_ITEMS, mAdapter.retainItems());
    }
  }
 @Override
 public void onSaveInstanceState(Bundle outState) {
   outState.putBoolean(FOOTER_VISIBLE, mFooter != null ? mFooter.isShown() : false);
   outState.putParcelableArrayList(OPTION_ITEMS_LIST, mOptionItems);
   outState.putStringArrayList(UPDATED_ITEMS, new ArrayList<String>(mUpdatedElements));
   outState.putStringArrayList(CHERRY_ITEMS, new ArrayList<String>(mCherryElements));
   super.onSaveInstanceState(outState);
 }
Пример #22
0
 private void loadHome() {
   ft = getFragmentManager().beginTransaction();
   initDate();
   Bundle bundle = new Bundle();
   bundle.putParcelableArrayList("list", mList);
   ft.replace(R.id.user_content, UserHome.newInstance(bundle));
   ft.commit();
 }
Пример #23
0
 public static GdeListFragment newInstance(@NonNull ArrayList<Gde> gdes, boolean active) {
   GdeListFragment fragment = new GdeListFragment();
   Bundle arguments = new Bundle();
   arguments.putParcelableArrayList(ARG_GDES, gdes);
   arguments.putBoolean(ARG_ACTIVE, active);
   fragment.setArguments(arguments);
   return fragment;
 }
Пример #24
0
  @Override
  public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);

    final ArrayList<AugmentedQuote> quotes = new ArrayList<>(mAdapter.getQuotes());
    outState.putParcelableArrayList(QuoteFragment.SAVED_ADAPTER_STATE, quotes);
    outState.putInt(PAGES_SAVED_STATE, mTotalPages);
  }
Пример #25
0
  @Override
  public void onSaveInstanceState(Bundle outState) {
    if (mQuestions != null && mQuestions.size() > 0) {
      outState.putParcelableArrayList(SAVED_QUESTIONS, mQuestions);
    }

    super.onSaveInstanceState(outState);
  }
Пример #26
0
 @Override
 protected void onSaveInstanceState(Bundle outState) {
   super.onSaveInstanceState(outState);
   // Se salva el estado del RecyclerView.
   mEstadoLista = mGridLayoutManager.onSaveInstanceState();
   outState.putParcelable(STATE_LISTA, mEstadoLista);
   outState.putParcelableArrayList(STATE_LISTA_DATOS, mAdaptador.getData());
   outState.putString(STATE_MAX_TAG_ID, mMaxTagId);
 }
  public static PickerFragment newInstance(List<Picker> pickerList) {
    PickerFragment pickerFragment = new PickerFragment();

    Bundle args = new Bundle();
    args.putParcelableArrayList(EXTRA_PICKER_LIST, (ArrayList) pickerList);

    pickerFragment.setArguments(args);
    return pickerFragment;
  }
 @Override
 protected void onSaveInstanceState(Bundle outState) {
   outState.putInt(SAVED_INSTANCE_ACTIVE_FRAGMENT, activeFragment);
   if (activeFragment == UtilFragment.FRAGMENT_MOVIE_DETAIL)
     if (selectedMovie != null) outState.putParcelable(SAVED_INSTANCE_MOVIE, selectedMovie);
   if (movies != null)
     outState.putParcelableArrayList(SAVED_INSTANCE_MOVIES, new ArrayList<Parcelable>(movies));
   super.onSaveInstanceState(outState);
 }
Пример #29
0
  @Override
  protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);

    if (mSpinnerAdapter.getCount() > 0)
      outState.putParcelableArrayList("chapters", mSpinnerAdapter.getAll());
    if (mViewPagerAdapter.getSelectedChapter() != null)
      outState.putParcelable("selected_chapter", mViewPagerAdapter.getSelectedChapter());
  }
Пример #30
0
 public static final Fragment_Resultado_Busquedas newInstance(
     ArrayList<Local_DTO> local_dtos, String busqueda) {
   Fragment_Resultado_Busquedas fragment_resultado_busquedas = new Fragment_Resultado_Busquedas();
   Bundle bundle = new Bundle();
   bundle.putParcelableArrayList("local_dtos", local_dtos);
   bundle.putString("busqueda", busqueda);
   fragment_resultado_busquedas.setArguments(bundle);
   return fragment_resultado_busquedas;
 }