android.os.Bundle#putSerializable ( )源码实例Demo

下面列出了android.os.Bundle#putSerializable ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: imsdk-android   文件: ImagePicker.java
/**
 * 用于手机内存不足,进程被系统回收时的状态保存
 */
public void saveInstanceState(Bundle outState) {
    outState.putSerializable("cropCacheFolder", cropCacheFolder);
    outState.putSerializable("takeImageFile", takeImageFile);
    outState.putSerializable("imageLoader", imageLoader);
    outState.putSerializable("style", style);
    outState.putBoolean("multiMode", multiMode);
    outState.putBoolean("crop", crop);
    outState.putBoolean("showCamera", showCamera);
    outState.putBoolean("isSaveRectangle", isSaveRectangle);
    outState.putInt("selectLimit", selectLimit);
    outState.putInt("outPutX", outPutX);
    outState.putInt("outPutY", outPutY);
    outState.putInt("focusWidth", focusWidth);
    outState.putInt("focusHeight", focusHeight);
}
 
public static void showDialog(FragmentManager fragmentManager, PermissifyManager.PendingPermissionCall pendingPermissionCall) {
    if (fragmentManager.findFragmentByTag(TAG) != null) {
        Log.w(TAG, "Dialog is already on screen - rejecting show command");
        return;
    }

    Bundle args = new Bundle();
    args.putSerializable(ARG_PENDING_CALL, pendingPermissionCall);

    PermissionRationaleDialogFragment dialog = new PermissionRationaleDialogFragment();
    dialog.setArguments(args);
    dialog.setCancelable(false);

    fragmentManager
        .beginTransaction()
        .add(dialog, TAG)
        .commitAllowingStateLoss();
}
 
源代码3 项目: open-rmbt   文件: RMBTTermsCheckFragment.java
public static RMBTTermsCheckFragment newInstance(final CheckType followedBy) {
	final RMBTTermsCheckFragment f = new RMBTTermsCheckFragment();
	final Bundle bdl = new Bundle(1);
	bdl.putSerializable("followedByType", followedBy);
    f.setArguments(bdl);
    return f;
}
 
public static DialogNewAndroidResource newInstance(@NonNull JavaProjectFolder p, @Nullable File currentFolder) {
    Bundle args = new Bundle();
    args.putSerializable(KEY_PROJECT_FILE, p);
    args.putSerializable(KEY_PARENT_FILE, currentFolder);
    DialogNewAndroidResource fragment = new DialogNewAndroidResource();
    fragment.setArguments(args);
    return fragment;
}
 
源代码5 项目: android_dbinspector   文件: CopyDbIntentService.java
/**
 * Start service to copy the database. It will be copied to the app's directory
 *
 * @param context  : Context to start service
 * @param database : File with the database that we want to copy
 */
public static void startService(Context context, File database) {
    Bundle bundle = new Bundle();
    bundle.putSerializable(EXTRA_FILE, database);
    Intent intent = new Intent(context, CopyDbIntentService.class);
    intent.putExtras(bundle);
    context.startService(intent);
}
 
源代码6 项目: android-skeleton-project   文件: LoginActivity.java
private void onAuthClientCompleted(AuthorizationClient.Result outcome) {
    request = null;

    int resultCode = (outcome.code == AuthorizationClient.Result.Code.CANCEL) ?
            RESULT_CANCELED : RESULT_OK;

    Bundle bundle = new Bundle();
    bundle.putSerializable(RESULT_KEY, outcome);

    Intent resultIntent = new Intent();
    resultIntent.putExtras(bundle);
    setResult(resultCode, resultIntent);

    finish();
}
 
源代码7 项目: javaide   文件: DialogLayoutPreview.java
public static DialogLayoutPreview newInstance(File content) {

        Bundle args = new Bundle();
        args.putSerializable("file", content);
        DialogLayoutPreview fragment = new DialogLayoutPreview();
        fragment.setArguments(args);
        return fragment;
    }
 
源代码8 项目: YImagePicker   文件: CropPickerBuilder.java
/**
 * fragment构建
 *
 * @param imageListener 图片视频选择回调
 */
public MultiImageCropFragment pickWithFragment(OnImagePickCompleteListener imageListener) {
    checkVideoAndImage();
    MultiImageCropFragment mFragment = new MultiImageCropFragment();
    Bundle bundle = new Bundle();
    bundle.putSerializable(MultiImageCropActivity.INTENT_KEY_DATA_PRESENTER, presenter);
    bundle.putSerializable(MultiImageCropActivity.INTENT_KEY_SELECT_CONFIG, selectConfig);
    mFragment.setArguments(bundle);
    mFragment.setOnImagePickCompleteListener(imageListener);
    return mFragment;
}
 
源代码9 项目: NewFastFrame   文件: AlbumListFragment.java
public static AlbumListFragment newInstance(ArrayList<AlbumWrappedBean> albumBeans) {
    Bundle bundle = new Bundle();
    bundle.putSerializable(Constant.DATA, albumBeans);
    AlbumListFragment albumListFragment = new AlbumListFragment();
    albumListFragment.setArguments(bundle);
    return albumListFragment;
}
 
private void onAuthClientCompleted(AuthorizationClient.Result outcome) {
    request = null;

    int resultCode = (outcome.code == AuthorizationClient.Result.Code.CANCEL) ?
            RESULT_CANCELED : RESULT_OK;

    Bundle bundle = new Bundle();
    bundle.putSerializable(RESULT_KEY, outcome);

    Intent resultIntent = new Intent();
    resultIntent.putExtras(bundle);
    setResult(resultCode, resultIntent);

    finish();
}
 
源代码11 项目: Phonograph   文件: FoldersFragment.java
public static FoldersFragment newInstance(File directory) {
    FoldersFragment frag = new FoldersFragment();
    Bundle b = new Bundle();
    b.putSerializable(PATH, directory);
    frag.setArguments(b);
    return frag;
}
 
源代码12 项目: Pioneer   文件: NewsActivity.java
private void navigateToDetail(News item) {
    Bundle args = new Bundle(2);
    args.putSerializable(EXTRA_NEWS, item);
    if (getIntent().hasExtra(EXTRA_EDITABLE)) {
        args.putBoolean(EXTRA_EDITABLE, getIntent().getBooleanExtra(EXTRA_EDITABLE, false));
    }
    NewsDetailFragment fragment = NewsDetailFragment.newInstance(args);
    getSupportFragmentManager().beginTransaction()
            .replace(getSearchFragmentContainerId(), fragment, TAG_FRAG_DETAIL)
            .addToBackStack(null)
            .commit();
}
 
源代码13 项目: mobikul-standalone-pos   文件: CheckoutHandler.java
public void cashPayment(TotalModel totalModel) {
    FragmentManager fragmentManager = ((AppCompatActivity) context).getSupportFragmentManager();
    FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
    fragmentTransaction.setCustomAnimations(R.anim.enter_from_right, R.anim.exit_to_left);
    Fragment fragment;
    fragment = fragmentManager.findFragmentByTag(CashFragment.class.getSimpleName());
    if (fragment == null)
        fragment = new CashFragment();
    Bundle bundle = new Bundle();
    bundle.putSerializable("total", totalModel);
    fragment.setArguments(bundle);
    fragmentTransaction.add(((Checkout) context).checkoutBinding.frameLayout.getId(), fragment, fragment.getClass().getSimpleName());
    fragmentTransaction.addToBackStack(fragment.getClass().getSimpleName()).commit();
}
 
public static ImageZoomFragment newInstance(RestaurantImage contentItem, int pos) {
    ImageZoomFragment f = new ImageZoomFragment();
    Bundle args = new Bundle();
    args.putSerializable("content", contentItem);
    args.putInt("pos", pos);
    f.setArguments(args);
    return f;
}
 
源代码15 项目: kute   文件: FriendTab.java
public void setupCurrentFriends()
{
    Log.d(TAG,"Setting Up Current Friend");
    FriendFrame f=new FriendFrame();
    Bundle args=new Bundle();
    args.putSerializable("Friend_1",friend_detail_list.get(0));
    f.setArguments(args);
    viewall_currentfriends.setEnabled(true);
    getChildFragmentManager().beginTransaction().replace(R.id.currentFriendsFrame,f).commit();
}
 
源代码16 项目: cathode   文件: RemoveFromHistoryDialog.java
public static Bundle getArgs(Type type, long id, String title, String showTitle) {
  Bundle args = new Bundle();
  args.putSerializable(ARG_TYPE, type);
  args.putLong(ARG_ID, id);
  args.putString(ARG_TITLE, title);
  args.putString(ARG_SHOW_TITLE, showTitle);
  return args;
}
 
源代码17 项目: deltachat-android   文件: SearchFragment.java
public static SearchFragment newInstance(@NonNull Locale locale) {
  Bundle args = new Bundle();
  args.putSerializable(EXTRA_LOCALE, locale);

  SearchFragment fragment = new SearchFragment();
  fragment.setArguments(args);

  return fragment;
}
 
源代码18 项目: VideoOS-Android-SDK   文件: VideoPlusAdapter.java
public void notifyMediaStatusChanged(MediaStatus status) {
    Bundle bundle = new Bundle();
    bundle.putSerializable("media_changed", status);
    ObservableManager.getDefaultObserable().sendToTarget(VenvyObservableTarget.TAG_MEDIA_CHANGED, bundle);
}
 
源代码19 项目: alltv   文件: FetchChannelService.java
@Override
protected void onHandleIntent(Intent intent) {

    if (intent != null) {
        ResultReceiver channelResultReceiver = intent
                .getParcelableExtra(getStringById(R.string.FETCHCHANNELRESULTRECEIVER_STR));

        Gson gson = new Gson();
        SettingsData settingsData = gson.fromJson(intent
                .getStringExtra(getStringById(R.string.SETTINGSDATA_STR)), SettingsData.class);

        Utils.SiteType siteType = (Utils.SiteType) intent.getSerializableExtra(getStringById(R.string.SITETYPE_STR));

        if (siteType == Utils.SiteType.Pooq) {
            mSiteProcessor = new PooqSiteProcessor(getApplicationContext());
        } else if (siteType == Utils.SiteType.Tving) {
            mSiteProcessor = new TvingSiteProcessor(getApplicationContext());
        } else if (siteType == Utils.SiteType.Oksusu) {
            mSiteProcessor = new OksusuSiteProcessor(getApplicationContext());
        }

        String authkey = (String) intent.getSerializableExtra(getStringById(R.string.AUTHKEY_STR));

        if (authkey == null || authkey.length() == 0) {
            mSiteProcessor.setAuthKey("");
        } else {
            mSiteProcessor.setAuthKey(authkey);
        }

        String mode = (String) intent.getSerializableExtra(getStringById(R.string.FETCHMODE_STR));

        ArrayList<ChannelData> channels = new ArrayList<>();
        ArrayList<CategoryData> category = new ArrayList<>();
        boolean error = false;

        if(mode.equals("create")) {
            if (mSiteProcessor.doProcess(settingsData)) {
                channels = mSiteProcessor.getChannelList();
                category = mSiteProcessor.getCategorylList();
            } else {
                error = true;
            }
        } else if(mode.equals("refresh")) {
            channels = intent.getParcelableArrayListExtra(getStringById(R.string.CHANNELS_STR));
            category = intent.getParcelableArrayListExtra(getStringById(R.string.CATEGORY_STR));

            mSiteProcessor.setChannelList(channels);
            mSiteProcessor.setCategorylList(category);

            if(!mSiteProcessor.updateProcess()) {
                error = true;
            }
        }

        Bundle retBundle = new Bundle();
        retBundle.putParcelableArrayList(getStringById(R.string.CHANNELS_STR), channels);
        retBundle.putParcelableArrayList(getStringById(R.string.CATEGORY_STR), category);
        retBundle.putString(getStringById(R.string.AUTHKEY_STR), mSiteProcessor.getAuthKey());
        retBundle.putSerializable(getStringById(R.string.SITETYPE_STR), siteType);
        retBundle.putString(getStringById(R.string.FETCHMODE_STR), mode);

        int retCode;

        if(error) retCode = Utils.Code.ServiceIntent_Fail.ordinal();
        else      retCode = Utils.Code.ServiceIntent_OK.ordinal();

        channelResultReceiver.send(retCode, retBundle);
    }
}
 
public void setActionToBeAssigned(Action actionToBeAssigned) {
  this.actionToBeAssigned = actionToBeAssigned;
  Bundle args = new Bundle();
  args.putSerializable(ACTION_KEY, actionToBeAssigned);
  setArguments(args);
}