/** Get current saved sates of the Caldroid. Useful for handling rotation */
  public Bundle getSavedStates() {
    Bundle bundle = new Bundle();
    bundle.putInt(MONTH, month);
    bundle.putInt(YEAR, year);

    if (dialogTitle != null) {
      bundle.putString(DIALOG_TITLE, dialogTitle);
    }

    if (selectedDates != null && selectedDates.size() > 0) {
      bundle.putStringArrayList(SELECTED_DATES, CalendarHelper.convertToStringList(selectedDates));
    }

    if (disableDates != null && disableDates.size() > 0) {
      bundle.putStringArrayList(DISABLE_DATES, CalendarHelper.convertToStringList(disableDates));
    }

    if (minDateTime != null) {
      bundle.putString(MIN_DATE, minDateTime.format("YYYY-MM-DD"));
    }

    if (maxDateTime != null) {
      bundle.putString(MAX_DATE, maxDateTime.format("YYYY-MM-DD"));
    }

    bundle.putBoolean(SHOW_NAVIGATION_ARROWS, showNavigationArrows);
    bundle.putBoolean(ENABLE_SWIPE, enableSwipe);
    bundle.putInt(START_DAY_OF_WEEK, startDayOfWeek);
    bundle.putBoolean(SIX_WEEKS_IN_CALENDAR, sixWeeksInCalendar);

    return bundle;
  }
 @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);
 }
  @Override
  public void onSaveInstanceState(Bundle outState) {

    outState.putStringArrayList("id", movie_id);
    outState.putStringArrayList("backdrop", backdrop);
    outState.putStringArrayList("original_title", original_title);
    outState.putStringArrayList("overview", overview);
    outState.putStringArrayList("vote_average", vote_average);
    outState.putStringArrayList("release_date", release_date);

    super.onSaveInstanceState(outState);
  }
Example #4
0
 public VideoFragment newInstance(TwitchVod h, TwitchVideo twitchVideo) {
   VideoFragment fragment = new VideoFragment();
   Bundle args = new Bundle();
   args.putInt("start_index", h.getStartOffsetIndex());
   args.putStringArrayList("lengths", h.getLengths());
   args.putStringArrayList("qualities", h.getAvailableQualities());
   args.putSerializable("data", h.toHashmap());
   args.putString("title", twitchVideo.mTitle);
   args.putString("description", twitchVideo.mDesc);
   args.putString("views", twitchVideo.mViews);
   args.putString("previewLink", twitchVideo.mPreviewLink);
   fragment.setArguments(args);
   return fragment;
 }
  @Override
  public void onSaveInstanceState(Bundle outState) {

    if (artists != null && artists.size() > 0) {
      for (int i = 0; i < artists.size(); i++) {
        artistNames.add(i, artists.get(i).artistName);
        artistPhotoUrls.add(i, artists.get(i).artistPhotoUrl);
      }
    }
    outState.putString(SEARCHED_ARTIST, searchedArtist);
    outState.putStringArrayList(ARTIST_NAME, artistNames);
    outState.putStringArrayList(ARTIST_ART, artistPhotoUrls);

    super.onSaveInstanceState(outState);
  }
 public void back(View view) {
   Intent i = new Intent(getApplicationContext(), ListaURL.class);
   Bundle b = new Bundle();
   b.putStringArrayList("lista", lista);
   i.putExtras(b);
   startActivity(i);
 }
 /**
  * Add extended data to the extra.
  *
  * @param name The name of the extra data, with package prefix.
  * @param value The ArrayList<String> data value.
  * @return Returns the same extra object, for chaining multiple calls into a single statement.
  * @see #putExtras
  * @see #removeExtra
  * @see #getStringArrayListExtra(String)
  */
 public Request putStringArrayListExtra(String name, ArrayList<String> value) {
   if (mExtras == null) {
     mExtras = new Bundle();
   }
   mExtras.putStringArrayList(name, value);
   return this;
 }
Example #8
0
  private void initPlugins() {
    Bundle extras = new Bundle(1);

    ArrayList<String> unpack_libs = new ArrayList<String>(1);
    // This is the common ResidualVM code (not really a "plugin" as such)
    unpack_libs.add(
        new Uri.Builder()
            .scheme("plugin")
            .authority(getPackageName())
            .path("lib/armeabi/libresidualvm.so")
            .toString());
    extras.putStringArrayList(ResidualVMApplication.EXTRA_UNPACK_LIBS, unpack_libs);

    final PackageInfo info;
    try {
      info = getPackageManager().getPackageInfo(getPackageName(), 0);
    } catch (PackageManager.NameNotFoundException e) {
      Log.e(LOG_TAG, "Error finding my own info?", e);
      return;
    }
    extras.putString(ResidualVMApplication.EXTRA_VERSION, info.versionName);

    Intent intent = new Intent(ResidualVMApplication.ACTION_PLUGIN_QUERY);
    // Android 3.1 defaults to FLAG_EXCLUDE_STOPPED_PACKAGES, and since
    // none of our plugins will ever be running, that is not helpful
    intent.setFlags(FLAG_INCLUDE_STOPPED_PACKAGES);
    sendOrderedBroadcast(
        intent,
        Manifest.permission.RESIDUALVM_PLUGIN,
        new PluginBroadcastReciever(),
        null,
        RESULT_OK,
        null,
        extras);
  }
Example #9
0
 @Test
 public void testShouldReadEmptyList() throws Exception {
   final Bundle bundle = new Bundle();
   bundle.putStringArrayList(Skus.BUNDLE_LIST, new ArrayList<String>());
   final Skus skus = Skus.fromBundle(bundle, "test");
   assertTrue(skus.list.isEmpty());
 }
Example #10
0
  @Override
  protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);

    ArrayList<String> vals = new ArrayList<String>();
    ArrayList<Integer> ids = new ArrayList<Integer>();
    int newone = 0;

    for (int i = 0; i < max; i++) {
      if (!checkFiles(i)) {
        newone = i;
        ids.add(i);
        vals.add(thetexts.get(i).edit.getText().toString());
      } else if (thetexts.get(i).changed) {
        ids.add(i);
        vals.add(thetexts.get(i).edit.getText().toString());
      }
    }

    if (newone > 0) outState.putInt("newone", newone);
    outState.putStringArrayList("vals", vals);
    outState.putIntegerArrayList("ids", ids);
    if (curfocus != null) outState.putInt("curfocus", curfocus.getId());
    outState.putBoolean("OKAY", true);
  }
 @Override
 public void onClick(View v) {
   switch (v.getId()) {
     case R.id.shareqq_commit: // 提交
       final Bundle params = new Bundle();
       params.putString(GameAppOperation.QQFAV_DATALINE_APPNAME, appName.getText().toString());
       params.putString(GameAppOperation.QQFAV_DATALINE_TITLE, title.getText().toString());
       params.putString(GameAppOperation.QQFAV_DATALINE_DESCRIPTION, summary.getText().toString());
       params.putString(GameAppOperation.TROOPBAR_ID, troopbarId.getText().toString());
       String srFileData = imageUrl.getText().toString();
       if (!TextUtils.isEmpty(srFileData)) {
         ArrayList<String> fileDataList = new ArrayList<String>();
         srFileData.replace(" ", "");
         String[] filePaths = srFileData.split(";");
         int size = filePaths.length;
         for (int i = 0; i < size; i++) {
           String path = filePaths[i].trim();
           if (!TextUtils.isEmpty(path)) {
             fileDataList.add(path);
           }
         }
         params.putStringArrayList(GameAppOperation.QQFAV_DATALINE_FILEDATA, fileDataList);
       }
       doShareToTroopBar(params);
       return;
     case R.id.radioBtn_local_image: // 本地图片
       startPickLocaleImage(this);
       return;
     default:
       break;
   }
 }
Example #12
0
 /** 转到公交站选择界面 */
 public void startline() {
   Intent intent = new Intent(BusReminder.this, StationsList.class);
   Bundle bundle = new Bundle();
   bundle.putStringArrayList("list", busStations);
   intent.putExtras(bundle);
   BusReminder.this.startActivityForResult(intent, 1);
 }
  public static void sendMsgToHandler(Handler handler, Object object, boolean isSucc) {
    if (handler == null || object == null) {
      Log.e(TAG, "传入参数不能为空");
      return;
    }
    Message message = handler.obtainMessage();
    Bundle bundle = new Bundle();

    if (object instanceof String) {
      bundle.putString("data", object.toString());
    } else if (object instanceof ArrayList<?>) {
      bundle.putStringArrayList("data", (ArrayList) object);
    } else if (object instanceof OrderStatus_O_Data) {
      bundle.putSerializable("data", (OrderStatus_O_Data) object);
    } else if (object instanceof Result) {
      bundle.putSerializable("data", (Result) object);
    } else if (object instanceof AddRespData) {
      bundle.putSerializable("data", (AddRespData) object);
    } else if (object instanceof AddPhoneInfoRespData) {
      bundle.putSerializable("data", (AddPhoneInfoRespData) object);
    } else if (object instanceof AddOrderInfo) {
      bundle.putSerializable("data", (AddOrderInfo) object);
    } else if (object instanceof JuheOrderInfo) {
      bundle.putSerializable("data", (JuheOrderInfo) object);
    } else {
      bundle.putString("data", "参数类型未定义,请至工具类定义");
    }
    message.setData(bundle);
    if (isSucc) {
      message.what = 1;
    } else {
      message.what = -1;
    }
    handler.sendMessage(message);
  }
Example #14
0
  int querySkuDetails(Inventory inv, List<String> moreSkus) throws RemoteException, JSONException {
    ArrayList<String> skuList = new ArrayList<String>();
    skuList.addAll(inv.getAllOwnedSkus(ITEM_TYPE_INAPP));
    if (moreSkus != null) skuList.addAll(moreSkus);

    if (skuList.size() == 0) {
      return BILLING_RESPONSE_RESULT_OK;
    }

    Bundle querySkus = new Bundle();
    querySkus.putStringArrayList(GET_SKU_DETAILS_ITEM_LIST, skuList);
    Bundle skuDetails = connection.getSkuDetails(querySkus);

    if (!skuDetails.containsKey(RESPONSE_GET_SKU_DETAILS_LIST)) {
      int response = getResponseCodeFromBundle(skuDetails);
      if (response != BILLING_RESPONSE_RESULT_OK) {
        return response;
      } else {
        return HELPER_BAD_RESPONSE;
      }
    }

    ArrayList<String> responseList = skuDetails.getStringArrayList(RESPONSE_GET_SKU_DETAILS_LIST);

    for (String thisResponse : responseList) {
      SkuDetails d = new SkuDetails(thisResponse);
      inv.addSkuDetails(d);
    }
    return BILLING_RESPONSE_RESULT_OK;
  }
 public static UpdatePathFragment newInstance(ArrayList<String> pathIds) {
   UpdatePathFragment frag = new UpdatePathFragment();
   Bundle args = new Bundle();
   args.putStringArrayList(PATH_IDS_KEY, pathIds);
   frag.setArguments(args);
   return frag;
 }
  @Override
  public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);

    outState.putStringArrayList(PATH_IDS_KEY, mPathIds);
    // todo: save checkbox states
  }
  // /防止内存不够用
  @Override
  protected void onSaveInstanceState(Bundle outState) {

    // 内容
    outState.putString("content", contentEditText.getText().toString());
    // 地点
    outState.putString("location", locationString);
    // 图片
    ArrayList<String> imageList = new ArrayList<String>();
    int subviewsCount = addImageLayout.getChildCount();
    for (int i = 0; i < subviewsCount; i++) {
      View view = addImageLayout.getChildAt(i);
      if (null != view.getTag() && view != addImageView) {
        if (view.getTag() instanceof String) {
          imageList.add((String) view.getTag());
        }
      }
    }
    outState.putStringArrayList("images", imageList);
    if (null != tmpImageName && tmpImageName.length() > 0) {
      // 刚拍的照片
      outState.putString("tmpImageName", tmpImageName);
    }

    super.onSaveInstanceState(outState);
  }
 /** Builds the {@link MediaRouteSelector media route selector}. */
 public MediaRouteSelector build() {
   if (mControlCategories == null) {
     return EMPTY;
   }
   Bundle bundle = new Bundle();
   bundle.putStringArrayList(KEY_CONTROL_CATEGORIES, mControlCategories);
   return new MediaRouteSelector(bundle, mControlCategories);
 }
 /**
  * Use this factory method to create a new instance of this fragment using the provided
  * parameters.
  *
  * @return A new instance of fragment ImagePreviewFragemnt.
  */
 public static ImagePreviewFragemnt newInstance(ArrayList<String> param1, int pos) {
   ImagePreviewFragemnt fragment = new ImagePreviewFragemnt();
   Bundle args = new Bundle();
   args.putStringArrayList("images", param1);
   args.putInt("pos", pos);
   fragment.setArguments(args);
   return fragment;
 }
 /** {@inheritDoc}. */
 @Override
 protected void onSaveInstanceState(Bundle savedInstanceState) {
   Log.d(TAG, "BEGIN onSaveInstanceState.");
   savedInstanceState.putStringArrayList(
       SAVED_INSTANCE_KEY_PRIVACY_LISTS, (ArrayList<String>) mPrivacyListNames);
   Log.d(TAG, "END onSaveInstanceState.");
   super.onSaveInstanceState(savedInstanceState);
 }
 @Override
 public void onSaveInstanceState(Bundle outState) {
   super.onSaveInstanceState(outState);
   outState.putStringArrayList(STATE_KEY_DIR_STACK, new ArrayList<>(mDirStack));
   for (Map.Entry<String, ArrayList<RepositoryContents>> entry : mContentCache.entrySet()) {
     String key = entry.getKey();
     outState.putSerializable(STATE_KEY_CONTENT_CACHE_PREFIX + key, entry.getValue());
   }
 }
  @Override
  public void writeToParcel(Parcel dest, int flags) {
    super.writeToParcel(dest, flags);
    Bundle bundle = new Bundle();
    bundle.putStringArrayList(BUNDLE_KEY_LINES, lines);
    // Add more stuff here

    dest.writeBundle(bundle);
  }
  public void saveInstanceState(Bundle outState) {
    ArrayList<String> callIds = new ArrayList<String>(pendingCallMap.keySet());
    outState.putStringArrayList(CALL_ID_ARRAY_KEY, callIds);

    for (FacebookDialog.PendingCall pendingCall : pendingCallMap.values()) {
      String stateKey = getSavedStateKeyForPendingCallId(pendingCall.getCallId().toString());
      outState.putParcelable(stateKey, pendingCall);
    }
  }
Example #24
0
 public f a() {
   if (a == null) {
     return f.a;
   } else {
     Bundle bundle = new Bundle();
     bundle.putStringArrayList("controlCategories", a);
     return new f(bundle, a, null);
   }
 }
Example #25
0
    static DoctorListDialogFragment newInstance(ArrayList<String> stringArrayList) {
      DoctorListDialogFragment f = new DoctorListDialogFragment();

      // Supply stringArrayList input as an argument.
      Bundle args = new Bundle();
      args.putStringArrayList("stringArrayList", stringArrayList);
      f.setArguments(args);

      return f;
    }
 public void addParameter(String s, String s1) {
   if (!Du.containsKey(s)) {
     ArrayList arraylist = new ArrayList();
     arraylist.add(s1);
     Du.putStringArrayList(s, arraylist);
     return;
   } else {
     Du.getStringArrayList(s).add(s1);
     return;
   }
 }
  public static Bundle purchasesResponseOneTransactionFullEdition() {
    Bundle bundle = new Bundle();

    bundle.putInt(RESPONSE_CODE, BILLING_RESPONSE_RESULT_OK.getCode());

    bundle.putStringArrayList(
        INAPP_PURCHASE_DATA_LIST,
        makeStringArrayListForTransaction(transactionFullEditionEuroGooglePlay()));

    return bundle;
  }
  public static QuizPreviousResultDialogFragment getInstance(
      ArrayList<String> answers, int correctAnswer) {
    QuizPreviousResultDialogFragment fragment = new QuizPreviousResultDialogFragment();

    Bundle arguments = new Bundle();
    arguments.putStringArrayList(EXTRA_KEY_ANSWERS, answers);
    arguments.putInt(EXTRA_KEY_CORRECT_ANSWER_ID, correctAnswer);
    fragment.setArguments(arguments);

    return fragment;
  }
 @Override
 protected void onPostExecute(Boolean result) {
   textView.setText(R.string.processOff);
   ibBack.setVisibility(View.VISIBLE);
   lista = temp;
   Intent i = new Intent(getApplicationContext(), ListaURL.class);
   Bundle b = new Bundle();
   b.putStringArrayList("lista", temp);
   i.putExtras(b);
   startActivity(i);
 }
Example #30
0
  private void handleIntent(Intent intent) {
    if (intent.hasExtra(EXTRA_POPOVER_LINK_LIST)) {
      ArrayList<String> urls = intent.getStringArrayListExtra(EXTRA_POPOVER_LINK_LIST);

      DialogFragment urlSelectDialog = new PopOverListDialogFragment();
      Bundle args = new Bundle();
      args.putStringArrayList(PopOverListDialogFragment.ARG_LINK_LIST, urls);
      urlSelectDialog.setArguments(args);
      urlSelectDialog.show(getSupportFragmentManager(), "url_list");
    }
  }