當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。