当前位置: 首页>>代码示例>>Java>>正文


Java Bundle.putSerializable方法代码示例

本文整理汇总了Java中android.os.Bundle.putSerializable方法的典型用法代码示例。如果您正苦于以下问题:Java Bundle.putSerializable方法的具体用法?Java Bundle.putSerializable怎么用?Java Bundle.putSerializable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.os.Bundle的用法示例。


在下文中一共展示了Bundle.putSerializable方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: newInstance

import android.os.Bundle; //导入方法依赖的package包/类
public static SponsorsDialog newInstance(ArrayList<DonateBean> dataList) {
    SponsorsDialog dialog = new SponsorsDialog();

    Bundle bundle = new Bundle();
    bundle.putSerializable("data", dataList);
    dialog.setArguments(bundle);

    return dialog;
}
 
开发者ID:by-syk,项目名称:NanoIconPack,代码行数:10,代码来源:SponsorsDialog.java

示例2: onItemSelected

import android.os.Bundle; //导入方法依赖的package包/类
/**
 * Opens the fragment that allows to change selected settings
 * @param position integer of selected setting in the list
 */
public void onItemSelected(int position){
    Bundle args = new Bundle();
    switch(position){
        case 0: // Text details
            SettingTextFragment txtFragment = new SettingTextFragment();
            args.putSerializable("SettingManager", settingsManager);
            txtFragment.setArguments(args);
            getSupportFragmentManager().beginTransaction().replace(R.id.setting_fragment_content, txtFragment).addToBackStack(null).commit();
            break;
        case 1: // Theme details
            SettingThemeFragment thmFragment = new SettingThemeFragment();
            args.putSerializable("SettingManager", settingsManager);
            thmFragment.setArguments(args);
            getSupportFragmentManager().beginTransaction().replace(R.id.setting_fragment_content, thmFragment).addToBackStack(null).commit();
            break;
        case 2: // TTS details
            SettingTTSFragment ttsFragment = new SettingTTSFragment();
            args.putSerializable("SettingManager", settingsManager);
            ttsFragment.setArguments(args);
            getSupportFragmentManager().beginTransaction().replace(R.id.setting_fragment_content, ttsFragment).addToBackStack(null).commit();
            break;
    }
}
 
开发者ID:Visions-Team,项目名称:eBread,代码行数:28,代码来源:SettingListActivity.java

示例3: saveInstanceState

import android.os.Bundle; //导入方法依赖的package包/类
@Override
public final void saveInstanceState(@NonNull final Bundle outState) {
    outState.putSerializable(LOG_LEVEL_EXTRA, logLevel);
    outState.putParcelableArrayList(TABS_EXTRA, tabs);
    outState.putBoolean(SWITCHER_SHOWN_EXTRA, switcherShown);
    outState.putInt(SELECTED_TAB_INDEX_EXTRA, selectedTab != null ? indexOf(selectedTab) : -1);
    outState.putIntArray(PADDING_EXTRA, padding);
    outState.putBoolean(APPLY_PADDING_TO_TABS_EXTRA, applyPaddingToTabs);
    outState.putInt(TAB_ICON_ID_EXTRA, tabIconId);
    outState.putParcelable(TAB_ICON_BITMAP_EXTRA, tabIconBitmap);
    outState.putParcelable(TAB_BACKGROUND_COLOR_EXTRA, tabBackgroundColor);
    outState.putInt(TAB_CONTENT_BACKGROUND_COLOR_EXTRA, tabContentBackgroundColor);
    outState.putParcelable(TAB_TITLE_TEXT_COLOR_EXTRA, tabTitleTextColor);
    outState.putInt(TAB_CLOSE_BUTTON_ICON_ID_EXTRA, tabCloseButtonIconId);
    outState.putParcelable(TAB_CLOSE_BUTTON_ICON_BITMAP_EXTRA, tabCloseButtonIconBitmap);
    outState.putInt(TAB_PROGRESS_BAR_COLOR_EXTRA, tabProgressBarColor);
    outState.putBoolean(SHOW_TOOLBARS_EXTRA, showToolbars);
    outState.putCharSequence(TOOLBAR_TITLE_EXTRA, toolbarTitle);
    getContentRecyclerAdapter().saveInstanceState(outState);
}
 
开发者ID:michael-rapp,项目名称:ChromeLikeTabSwitcher,代码行数:21,代码来源:TabSwitcherModel.java

示例4: getInstance

import android.os.Bundle; //导入方法依赖的package包/类
public static AppFragment getInstance(DataType dataType){
    Bundle bundle = new Bundle();
    bundle.putSerializable("datatype", dataType);
    AppFragment appFragment = new AppFragment();
    appFragment.setArguments(bundle);
    return appFragment;
}
 
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:8,代码来源:AppFragment.java

示例5: onPurchasesUpdated

import android.os.Bundle; //导入方法依赖的package包/类
/**
 * After google payment successfully get response
 * @param purchaseList successful payment receive response
 */

void onPurchasesUpdated(List<Purchase> purchaseList) {
    Intent resultIntent = new Intent();
    Bundle args = new Bundle();
    args.putSerializable("result", (Serializable) purchaseList);
    resultIntent.putExtra("PurchaseBundle", args);
    activity.setResult(Activity.RESULT_OK, resultIntent);
    activity.finish();
}
 
开发者ID:uthayacloud,项目名称:AndroidInAppBilling,代码行数:14,代码来源:HomeActivity.java

示例6: onGoalAchieved

import android.os.Bundle; //导入方法依赖的package包/类
@Override
public void onGoalAchieved(DCGoal goal) {
    Fragment fragment = getFragmentManager().findFragmentByTag(DCMessageFragment.TAG);
    if (routine != null || (fragment != null && fragment.isVisible())) {
        return;
    }

    DCGoalDialogFragment goalFragment = new DCGoalDialogFragment();
    Bundle arguments = new Bundle();
    arguments.putSerializable(DCGoalDialogFragment.KEY_GOAL, goal);
    goalFragment.setArguments(arguments);
    goalFragment.show(getFragmentManager(), DCGoalDialogFragment.TAG);
    hideTutorials();
}
 
开发者ID:Dentacoin,项目名称:aftercare-app-android,代码行数:15,代码来源:DCDashboardActivity.java

示例7: getItem

import android.os.Bundle; //导入方法依赖的package包/类
@Override
public Fragment getItem(int position){
    Fragment f;
    final int pattern = position %size;

    f = new ShowImageFragment();
    Bundle bdl = new Bundle(1);
    bdl.putSerializable("url", list.get(pattern));
    f.setArguments(bdl);

    return f;
}
 
开发者ID:pooi,项目名称:Nearby,代码行数:13,代码来源:ShowImageActivity.java

示例8: getInstance

import android.os.Bundle; //导入方法依赖的package包/类
public static EditTaskFragment getInstance(Task task) {
    EditTaskFragment fragment = new EditTaskFragment();
    Bundle args = new Bundle();
    args.putSerializable(AppConstants.EDIT_EXTRA, task);
    fragment.setArguments(args);
    return fragment;
}
 
开发者ID:aumarbello,项目名称:Tasks,代码行数:8,代码来源:EditTaskFragment.java

示例9: newInstance

import android.os.Bundle; //导入方法依赖的package包/类
public static OrderServiceFragment newInstance(OrderModel model, boolean ref) {
    OrderServiceFragment fragment = new OrderServiceFragment();
    Bundle args = new Bundle();
    args.putSerializable("args", model);
    args.putBoolean("ref", ref);
    fragment.setArguments(args);
    return fragment;
}
 
开发者ID:fengdongfei,项目名称:CXJPadProject,代码行数:9,代码来源:OrderServiceFragment.java

示例10: newInstance

import android.os.Bundle; //导入方法依赖的package包/类
public static DatePickerFragment newInstance(Date date) {
    Bundle args = new Bundle();
    args.putSerializable(ARG_DATE, date);

    DatePickerFragment fragment = new DatePickerFragment();
    fragment.setArguments(args);
    return fragment;
}
 
开发者ID:rsippl,项目名称:AndroidProgramming3e,代码行数:9,代码来源:DatePickerFragment.java

示例11: showOneInstanceOnly

import android.os.Bundle; //导入方法依赖的package包/类
public static <T extends Serializable> void showOneInstanceOnly(FragmentManager fragmentManager, List<T> options) {
    ListPickerFragmentDialog<T> dialog = new ListPickerFragmentDialog<>();

    Bundle args = new Bundle();
    args.putInt(ARGS_SIZE, options.size());
    for (int i = 0; i < options.size(); i++) {
        args.putSerializable(getArgKey(i), options.get(i));
    }

    dialog.showOneInstanceOnly(fragmentManager, DIALOG_TAG, args);
}
 
开发者ID:martinmarinov,项目名称:AndroidDvbDriver,代码行数:12,代码来源:ListPickerFragmentDialog.java

示例12: newInstance

import android.os.Bundle; //导入方法依赖的package包/类
private static ConfirmImportSyncDataDialog newInstance(
        String oldAccountName, String newAccountName, ImportSyncType importSyncType) {

    ConfirmImportSyncDataDialog fragment = new ConfirmImportSyncDataDialog();
    Bundle args = new Bundle();
    args.putString(KEY_OLD_ACCOUNT_NAME, oldAccountName);
    args.putString(KEY_NEW_ACCOUNT_NAME, newAccountName);
    args.putSerializable(KEY_IMPORT_SYNC_TYPE, importSyncType);
    fragment.setArguments(args);
    return fragment;
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:12,代码来源:ConfirmImportSyncDataDialog.java

示例13: loadDocument

import android.os.Bundle; //导入方法依赖的package包/类
public static Document loadDocument(Context context, Intent arguments, @Nullable Document existingDocument) {
    if (existingDocument != null) {
        return existingDocument;
    }

    Bundle bundle = new Bundle();
    if (arguments.hasExtra(EXTRA_DOCUMENT)) {
        bundle.putSerializable(EXTRA_DOCUMENT, arguments.getSerializableExtra(EXTRA_DOCUMENT));
    } else {
        bundle.putBoolean(EXTRA_ALLOW_RENAME, arguments.getBooleanExtra(EXTRA_ALLOW_RENAME, true));
        bundle.putSerializable(EXTRA_PATH, arguments.getSerializableExtra(EXTRA_PATH));
        bundle.putBoolean(EXTRA_PATH_IS_FOLDER, arguments.getBooleanExtra(EXTRA_PATH_IS_FOLDER, false));
    }
    return loadDocument(context, bundle, existingDocument);
}
 
开发者ID:gsantner,项目名称:markor,代码行数:16,代码来源:DocumentIO.java

示例14: newInstance

import android.os.Bundle; //导入方法依赖的package包/类
/**
 * creates a new instance of this class and initializes some fields
 * @param challenge the challenge to be displayed.
 * @return an instance of this class.
 */
public static DisplayChallengeFragment newInstance(Challenge challenge) {
    DisplayChallengeFragment fragment = new DisplayChallengeFragment();
    Bundle args = new Bundle();
    args.putSerializable(CHALLENGE_TO_BE_DISPLAYED, challenge);
    fragment.setArguments(args);
    return fragment;
}
 
开发者ID:IrrilevantHappyLlamas,项目名称:Runnest,代码行数:13,代码来源:DisplayChallengeFragment.java

示例15: newInstance

import android.os.Bundle; //导入方法依赖的package包/类
public static SelectProjectFragment newInstance(CodeCategory category) {

        Bundle args = new Bundle();
        args.putSerializable("category", category);
        SelectProjectFragment fragment = new SelectProjectFragment();
        fragment.setArguments(args);
        return fragment;
    }
 
开发者ID:tranleduy2000,项目名称:javaide,代码行数:9,代码来源:SelectProjectFragment.java


注:本文中的android.os.Bundle.putSerializable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。