本文整理汇总了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;
}
示例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;
}
}
示例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);
}
示例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;
}
示例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();
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}