Java Code Examples for android.os.Parcelable

The following code examples are extracted from open source projects. You can click to vote up the examples that are useful to you.

Example 1

From project 2Degrees-Toolbox, under directory /ActionBarSherlock/src/com/actionbarsherlock/internal/widget/.

Source file: ActionBarView.java

  32 
vote

@Override public Parcelable onSaveInstanceState(){
  Parcelable superState=super.onSaveInstanceState();
  SavedState state=new SavedState(superState);
  if (mExpandedMenuPresenter != null && mExpandedMenuPresenter.mCurrentExpandedItem != null) {
    state.expandedMenuItemId=mExpandedMenuPresenter.mCurrentExpandedItem.getItemId();
  }
  state.isOverflowOpen=isOverflowMenuShowing();
  return state;
}
 

Example 2

From project 4308Cirrus, under directory /Extras/actionbarsherlock/src/com/actionbarsherlock/internal/widget/.

Source file: ActionBarView.java

  32 
vote

@Override public Parcelable onSaveInstanceState(){
  Parcelable superState=super.onSaveInstanceState();
  SavedState state=new SavedState(superState);
  if (mExpandedMenuPresenter != null && mExpandedMenuPresenter.mCurrentExpandedItem != null) {
    state.expandedMenuItemId=mExpandedMenuPresenter.mCurrentExpandedItem.getItemId();
  }
  state.isOverflowOpen=isOverflowMenuShowing();
  return state;
}
 

Example 3

From project ActionBarSherlock, under directory /library/src/com/actionbarsherlock/internal/widget/.

Source file: ActionBarView.java

  32 
vote

@Override public Parcelable onSaveInstanceState(){
  Parcelable superState=super.onSaveInstanceState();
  SavedState state=new SavedState(superState);
  if (mExpandedMenuPresenter != null && mExpandedMenuPresenter.mCurrentExpandedItem != null) {
    state.expandedMenuItemId=mExpandedMenuPresenter.mCurrentExpandedItem.getItemId();
  }
  state.isOverflowOpen=isOverflowMenuShowing();
  return state;
}
 

Example 4

From project Amantech, under directory /Android/action_bar_sherlock/src/com/actionbarsherlock/internal/widget/.

Source file: ActionBarView.java

  32 
vote

@Override public Parcelable onSaveInstanceState(){
  Parcelable superState=super.onSaveInstanceState();
  SavedState state=new SavedState(superState);
  if (mExpandedMenuPresenter != null && mExpandedMenuPresenter.mCurrentExpandedItem != null) {
    state.expandedMenuItemId=mExpandedMenuPresenter.mCurrentExpandedItem.getItemId();
  }
  state.isOverflowOpen=isOverflowMenuShowing();
  return state;
}
 

Example 5

From project andlytics, under directory /actionbarsherlock/src/com/actionbarsherlock/internal/widget/.

Source file: ActionBarView.java

  32 
vote

@Override public Parcelable onSaveInstanceState(){
  Parcelable superState=super.onSaveInstanceState();
  SavedState state=new SavedState(superState);
  if (mExpandedMenuPresenter != null && mExpandedMenuPresenter.mCurrentExpandedItem != null) {
    state.expandedMenuItemId=mExpandedMenuPresenter.mCurrentExpandedItem.getItemId();
  }
  state.isOverflowOpen=isOverflowMenuShowing();
  return state;
}
 

Example 6

From project Android-FFXIEQ, under directory /ffxieq/src/com/github/kanata3249/ffxieq/android/.

Source file: FoodListView.java

  32 
vote

public boolean setParam(FFXIDAO dao){
  FoodListViewAdapter adapter;
  Cursor cursor;
  Parcelable state=onSaveInstanceState();
  mDao=(FFXIDatabase)dao;
  if (mFilterID != -1) {
    mFilter=((FFXIEQBaseActivity)getContext()).getSettings().getFilter(mFilterID);
  }
  cursor=mDao.getFoodsCursor(columns,mOrderBy,mFilter,mFilterByType);
  adapter=new FoodListViewAdapter(getContext(),R.layout.foodlistview,cursor,columns,views);
  setAdapter(adapter);
  onRestoreInstanceState(state);
  return true;
}
 

Example 7

From project android-joedayz, under directory /Proyectos/GreenDroid/src/greendroid/widget/.

Source file: AsyncImageView.java

  32 
vote

@Override public Parcelable onSaveInstanceState(){
  Parcelable superState=super.onSaveInstanceState();
  SavedState ss=new SavedState(superState);
  ss.url=mUrl;
  return ss;
}
 

Example 8

From project android-thaiime, under directory /common/src/com/android/ex/editstyledtext/.

Source file: EditStyledText.java

  32 
vote

@Override public Parcelable onSaveInstanceState(){
  Parcelable superState=super.onSaveInstanceState();
  SavedStyledTextState ss=new SavedStyledTextState(superState);
  ss.mBackgroundColor=mManager.getBackgroundColor();
  return ss;
}
 

Example 9

From project androidZenWriter, under directory /library/src/com/actionbarsherlock/internal/widget/.

Source file: ActionBarView.java

  32 
vote

@Override public Parcelable onSaveInstanceState(){
  Parcelable superState=super.onSaveInstanceState();
  SavedState state=new SavedState(superState);
  if (mExpandedMenuPresenter != null && mExpandedMenuPresenter.mCurrentExpandedItem != null) {
    state.expandedMenuItemId=mExpandedMenuPresenter.mCurrentExpandedItem.getItemId();
  }
  state.isOverflowOpen=isOverflowMenuShowing();
  return state;
}
 

Example 10

From project android_7, under directory /src/org/immopoly/android/widget/.

Source file: ViewPager.java

  32 
vote

@Override public Parcelable onSaveInstanceState(){
  Parcelable superState=super.onSaveInstanceState();
  SavedState ss=new SavedState(superState);
  ss.position=mCurItem;
  if (mAdapter != null) {
    ss.adapterState=mAdapter.saveState();
  }
  return ss;
}
 

Example 11

From project android_packages_apps_Nfc, under directory /src/com/android/nfc/.

Source file: TechListChooserActivity.java

  32 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  Intent intent=getIntent();
  Parcelable targetParcelable=intent.getParcelableExtra(Intent.EXTRA_INTENT);
  if (!(targetParcelable instanceof Intent)) {
    Log.w("TechListChooserActivity","Target is not an intent: " + targetParcelable);
    finish();
    return;
  }
  Intent target=(Intent)targetParcelable;
  ArrayList<ResolveInfo> rList=intent.getParcelableArrayListExtra(EXTRA_RESOLVE_INFOS);
  CharSequence title=getResources().getText(com.android.internal.R.string.chooseActivity);
  super.onCreate(savedInstanceState,target,title,null,rList,false);
}
 

Example 12

From project Barcamp-Bangalore-Android-App, under directory /slidingmenu/library/src/com/slidingmenu/lib/.

Source file: CustomViewAbove.java

  32 
vote

public Parcelable onSaveInstanceState(){
  Parcelable superState=super.onSaveInstanceState();
  SavedState ss=new SavedState(superState);
  ss.position=mCurItem;
  if (mAdapter != null) {
    ss.adapterState=mAdapter.saveState();
  }
  return ss;
}
 

Example 13

From project BF3-Battlelog, under directory /src/com/kmansoft/.

Source file: IntegerListPreference.java

  32 
vote

@Override protected Parcelable onSaveInstanceState(){
  final Parcelable superState=super.onSaveInstanceState();
  if (isPersistent()) {
    return superState;
  }
  final SavedState myState=new SavedState(superState);
  myState.value=getValue();
  return myState;
}
 

Example 14

From project CalendarView_1, under directory /src/org/kazzz/view/calendar/.

Source file: MonthlyCalendarView.java

  32 
vote

@Override protected Parcelable onSaveInstanceState(){
  Parcelable p=super.onSaveInstanceState();
  Bundle bundle=new Bundle();
  bundle.putInt(SELECT_COL,selCol);
  bundle.putInt(SELECT_ROW,selRow);
  bundle.putParcelable(VIEW_STATE,p);
  return bundle;
}
 

Example 15

From project CineShowTime-Android, under directory /Libraries/GreenDroid/src/greendroid/widget/.

Source file: AsyncImageView.java

  32 
vote

@Override public Parcelable onSaveInstanceState(){
  Parcelable superState=super.onSaveInstanceState();
  SavedState ss=new SavedState(superState);
  ss.url=mUrl;
  return ss;
}
 

Example 16

From project Common-Sense-Net-2, under directory /AndroidBarSherlock/src/com/actionbarsherlock/internal/widget/.

Source file: ActionBarView.java

  32 
vote

@Override public Parcelable onSaveInstanceState(){
  Parcelable superState=super.onSaveInstanceState();
  SavedState state=new SavedState(superState);
  if (mExpandedMenuPresenter != null && mExpandedMenuPresenter.mCurrentExpandedItem != null) {
    state.expandedMenuItemId=mExpandedMenuPresenter.mCurrentExpandedItem.getItemId();
  }
  state.isOverflowOpen=isOverflowMenuShowing();
  return state;
}
 

Example 17

From project cow, under directory /libs/ActionBarSherlock/library/src/com/actionbarsherlock/internal/widget/.

Source file: ActionBarView.java

  32 
vote

@Override public Parcelable onSaveInstanceState(){
  Parcelable superState=super.onSaveInstanceState();
  SavedState state=new SavedState(superState);
  if (mExpandedMenuPresenter != null && mExpandedMenuPresenter.mCurrentExpandedItem != null) {
    state.expandedMenuItemId=mExpandedMenuPresenter.mCurrentExpandedItem.getItemId();
  }
  state.isOverflowOpen=isOverflowMenuShowing();
  return state;
}
 

Example 18

From project creamed_glacier_app_settings, under directory /src/com/android/settings/.

Source file: AccessibilityEnableScriptInjectionPreference.java

  32 
vote

@Override protected Parcelable onSaveInstanceState(){
  Parcelable superState=super.onSaveInstanceState();
  if (isPersistent()) {
    return superState;
  }
  SavedState myState=new SavedState(superState);
  myState.mInjectionAllowed=mInjectionAllowed;
  return myState;
}
 

Example 19

From project cw-omnibus, under directory /external/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/.

Source file: ActionBarView.java

  32 
vote

@Override public Parcelable onSaveInstanceState(){
  Parcelable superState=super.onSaveInstanceState();
  SavedState state=new SavedState(superState);
  if (mExpandedMenuPresenter != null && mExpandedMenuPresenter.mCurrentExpandedItem != null) {
    state.expandedMenuItemId=mExpandedMenuPresenter.mCurrentExpandedItem.getItemId();
  }
  state.isOverflowOpen=isOverflowMenuShowing();
  return state;
}
 

Example 20

From project DeskSMS, under directory /ActionBarSherlock/src/com/actionbarsherlock/internal/widget/.

Source file: ActionBarView.java

  32 
vote

@Override public Parcelable onSaveInstanceState(){
  Parcelable superState=super.onSaveInstanceState();
  SavedState state=new SavedState(superState);
  if (mExpandedMenuPresenter != null && mExpandedMenuPresenter.mCurrentExpandedItem != null) {
    state.expandedMenuItemId=mExpandedMenuPresenter.mCurrentExpandedItem.getItemId();
  }
  state.isOverflowOpen=isOverflowMenuShowing();
  return state;
}
 

Example 21

From project dmix, under directory /ActionBarSherlock/src/com/actionbarsherlock/internal/widget/.

Source file: ActionBarView.java

  32 
vote

@Override public Parcelable onSaveInstanceState(){
  Parcelable superState=super.onSaveInstanceState();
  SavedState state=new SavedState(superState);
  if (mExpandedMenuPresenter != null && mExpandedMenuPresenter.mCurrentExpandedItem != null) {
    state.expandedMenuItemId=mExpandedMenuPresenter.mCurrentExpandedItem.getItemId();
  }
  state.isOverflowOpen=isOverflowMenuShowing();
  return state;
}
 

Example 22

From project android-shuffle, under directory /client/src/org/dodgybits/shuffle/android/core/activity/.

Source file: LauncherShortcutActivity.java

  31 
vote

@Override protected void onListItemClick(ListView l,View v,int position,long id){
  Intent shortcutIntent;
  Parcelable iconResource;
  if (position == NEW_TASK) {
    shortcutIntent=new Intent(Intent.ACTION_INSERT,TaskProvider.Tasks.CONTENT_URI);
    iconResource=Intent.ShortcutIconResource.fromContext(this,R.drawable.add_task_3d);
  }
 else {
    shortcutIntent=new Intent(this,LauncherShortcutActivity.class);
    shortcutIntent.putExtra(cScreenId,position);
    iconResource=Intent.ShortcutIconResource.fromContext(this,R.drawable.app_icon_3d);
  }
  Intent intent=new Intent();
  intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT,shortcutIntent);
  intent.putExtra(Intent.EXTRA_SHORTCUT_NAME,mLabels.get(position).trim());
  intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE,iconResource);
  setResult(RESULT_OK,intent);
  finish();
}
 

Example 23

From project android_aosp_packages_apps_Settings, under directory /src/com/android/settings/.

Source file: ActivityPicker.java

  31 
vote

@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  final Intent intent=getIntent();
  Parcelable parcel=intent.getParcelableExtra(Intent.EXTRA_INTENT);
  if (parcel instanceof Intent) {
    mBaseIntent=(Intent)parcel;
  }
 else {
    mBaseIntent=new Intent(Intent.ACTION_MAIN,null);
    mBaseIntent.addCategory(Intent.CATEGORY_DEFAULT);
  }
  AlertController.AlertParams params=mAlertParams;
  params.mOnClickListener=this;
  params.mOnCancelListener=this;
  if (intent.hasExtra(Intent.EXTRA_TITLE)) {
    params.mTitle=intent.getStringExtra(Intent.EXTRA_TITLE);
  }
 else {
    params.mTitle=getTitle();
  }
  List<PickAdapter.Item> items=getItems();
  mAdapter=new PickAdapter(this,items);
  params.mAdapter=mAdapter;
  setupAlert();
}
 

Example 24

From project android_packages_apps_Gallery2, under directory /src/com/android/gallery3d/app/.

Source file: StateManager.java

  31 
vote

@SuppressWarnings("unchecked") public void restoreFromState(Bundle inState){
  Log.v(TAG,"restoreFromState");
  Parcelable list[]=inState.getParcelableArray(KEY_MAIN);
  for (  Parcelable parcelable : list) {
    Bundle bundle=(Bundle)parcelable;
    Class<? extends ActivityState> klass=(Class<? extends ActivityState>)bundle.getSerializable(KEY_CLASS);
    Bundle data=bundle.getBundle(KEY_DATA);
    Bundle state=bundle.getBundle(KEY_STATE);
    ActivityState activityState;
    try {
      Log.v(TAG,"restoreFromState " + klass);
      activityState=klass.newInstance();
    }
 catch (    Exception e) {
      throw new AssertionError(e);
    }
    activityState.initialize(mContext,data);
    activityState.onCreate(data,state);
    mStack.push(new StateEntry(data,activityState));
  }
}
 

Example 25

From project ActionBarCompat, under directory /ActionBarCompat/src/sk/m217/actionbarcompat/.

Source file: ActionBarHelperBase.java

  29 
vote

/** 
 * {@inheritDoc}
 */
@Override public void onSaveInstanceState(Bundle outState){
  if (mExpandedMenuPresenter != null && mExpandedMenuPresenter.mCurrentExpandedItem != null) {
    outState.putInt(KEY_EXPANDED_ITEM,mExpandedMenuPresenter.mCurrentExpandedItem.getItemId());
  }
  final ViewGroup actionBarCompat=getActionBarCompat();
  if (actionBarCompat != null) {
    SparseArray<Parcelable> stateArray=new SparseArray<Parcelable>();
    actionBarCompat.saveHierarchyState(stateArray);
    outState.putSparseParcelableArray(KEY_HIERARCHY_STATE,stateArray);
  }
}
 

Example 26

From project android-bankdroid, under directory /src/com/liato/bankdroid/lockpattern/.

Source file: LockPatternView.java

  29 
vote

@Override protected void onRestoreInstanceState(Parcelable state){
  final SavedState ss=(SavedState)state;
  super.onRestoreInstanceState(ss.getSuperState());
  setPattern(DisplayMode.Correct,LockPatternUtils.stringToPattern(ss.getSerializedPattern()));
  mPatternDisplayMode=DisplayMode.values()[ss.getDisplayMode()];
  mInputEnabled=ss.isInputEnabled();
  mInStealthMode=ss.isInStealthMode();
  mTactileFeedbackEnabled=ss.isTactileFeedbackEnabled();
}
 

Example 27

From project android-pulltorefresh, under directory /library/src/com/handmark/pulltorefresh/library/.

Source file: PullToRefreshBase.java

  29 
vote

@Override protected void onRestoreInstanceState(Parcelable state){
  if (state instanceof Bundle) {
    Bundle bundle=(Bundle)state;
    mMode=Mode.mapIntToMode(bundle.getInt(STATE_MODE,0));
    mCurrentMode=Mode.mapIntToMode(bundle.getInt(STATE_CURRENT_MODE,0));
    mDisableScrollingWhileRefreshing=bundle.getBoolean(STATE_DISABLE_SCROLLING_REFRESHING,true);
    mShowViewWhileRefreshing=bundle.getBoolean(STATE_SHOW_REFRESHING_VIEW,true);
    super.onRestoreInstanceState(bundle.getParcelable(STATE_SUPER));
    final int viewState=bundle.getInt(STATE_STATE,WAITING);
    if (viewState == REFRESHING || viewState == MANUAL_REFRESHING) {
      setRefreshingInternal(true);
      mState=viewState;
    }
    return;
  }
  super.onRestoreInstanceState(state);
}
 

Example 28

From project androidannotations, under directory /AndroidAnnotations/functional-test-1-5-tests/src/test/java/com/xtremelabs/robolectric/shadows/.

Source file: CustomShadowBundle.java

  29 
vote

@Implementation public <T extends Parcelable>T getParcelable(String key){
  Object o=mMap.get(key);
  if (o == null) {
    return null;
  }
  try {
    return (T)o;
  }
 catch (  ClassCastException e) {
    return null;
  }
}
 

Example 29

From project Android_NFC_FelicaEdit, under directory /src/jp/co/yumemi/nfc/.

Source file: TagFactory.java

  29 
vote

public static NfcTag create(Parcelable tag){
  if (tag != null && tag instanceof Tag) {
    Tag t=(Tag)tag;
    if (NFCUtil.hasTech(t,NfcF.class)) {
      return new FelicaTag(t);
    }
 else {
      return new NfcTag(t);
    }
  }
  return new NullNfcTag(null);
}
 

Example 30

From project android_packages_apps_Gallery, under directory /src/com/android/camera/.

Source file: ImageGallery.java

  29 
vote

private void onShareMultipleClicked(){
  if (mMultiSelected.size() > 1) {
    Intent intent=new Intent();
    intent.setAction(Intent.ACTION_SEND_MULTIPLE);
    String mimeType=getShareMultipleMimeType();
    intent.setType(mimeType);
    ArrayList<Parcelable> list=new ArrayList<Parcelable>();
    for (    IImage image : mMultiSelected) {
      list.add(image.fullSizeImageUri());
    }
    intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM,list);
    try {
      startActivity(Intent.createChooser(intent,getText(R.string.send_media_files)));
    }
 catch (    android.content.ActivityNotFoundException ex) {
      Toast.makeText(this,R.string.no_way_to_share,Toast.LENGTH_SHORT).show();
    }
  }
 else   if (mMultiSelected.size() == 1) {
    IImage image=mMultiSelected.iterator().next();
    Intent intent=new Intent();
    intent.setAction(Intent.ACTION_SEND);
    String mimeType=image.getMimeType();
    intent.setType(mimeType);
    intent.putExtra(Intent.EXTRA_STREAM,image.fullSizeImageUri());
    boolean isImage=ImageManager.isImage(image);
    try {
      startActivity(Intent.createChooser(intent,getText(isImage ? R.string.sendImage : R.string.sendVideo)));
    }
 catch (    android.content.ActivityNotFoundException ex) {
      Toast.makeText(this,isImage ? R.string.no_way_to_share_image : R.string.no_way_to_share_video,Toast.LENGTH_SHORT).show();
    }
  }
}
 

Example 31

From project android_packages_apps_phone, under directory /src/com/android/phone/sip/.

Source file: SipSettings.java

  29 
vote

private void startSipEditor(final SipProfile profile){
  mProfile=profile;
  Intent intent=new Intent(this,SipEditor.class);
  intent.putExtra(KEY_SIP_PROFILE,(Parcelable)profile);
  startActivityForResult(intent,REQUEST_ADD_OR_EDIT_SIP_PROFILE);
}
 

Example 32

From project android_packages_apps_Superuser, under directory /src/com/noshufou/android/su/.

Source file: SuRequestActivity.java

  29 
vote

@TargetApi(9) @Override public void onNewIntent(Intent intent){
  Parcelable[] rawMsgs=intent.getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGES);
  if (rawMsgs != null) {
    NdefMessage msg=(NdefMessage)rawMsgs[0];
    NdefRecord record=msg.getRecords()[0];
    short tnf=record.getTnf();
    String type=new String(record.getType());
    if (tnf == NdefRecord.TNF_MIME_MEDIA && type.equals("text/x-su-a")) {
      String tagPin=new String(record.getPayload());
      if (tagPin.equals(mPrefs.getString("pin",""))) {
        sendResult(true,mRememberCheckBox.isChecked());
      }
    }
  }
}
 

Example 33

From project android_packages_inputmethods_LatinIME, under directory /java/src/com/android/inputmethod/deprecated/voice/.

Source file: VoiceInput.java

  29 
vote

@Override public void onResults(Bundle resultsBundle){
  List<String> results=resultsBundle.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
  Bundle alternatesBundle=resultsBundle.getBundle(ALTERNATES_BUNDLE);
  mState=DEFAULT;
  final Map<String,List<CharSequence>> alternatives=new HashMap<String,List<CharSequence>>();
  if (ENABLE_WORD_CORRECTIONS && alternatesBundle != null && results.size() > 0) {
    String[] words=results.get(0).split(" ");
    Bundle spansBundle=alternatesBundle.getBundle(AlternatesBundleKeys.SPANS);
    for (    String key : spansBundle.keySet()) {
      Bundle spanBundle=spansBundle.getBundle(key);
      int start=spanBundle.getInt(AlternatesBundleKeys.START);
      int length=spanBundle.getInt(AlternatesBundleKeys.LENGTH);
      if (length == 1 && start < words.length) {
        List<CharSequence> altList=alternatives.get(words[start]);
        if (altList == null) {
          altList=new ArrayList<CharSequence>();
          alternatives.put(words[start],altList);
        }
        Parcelable[] alternatesArr=spanBundle.getParcelableArray(AlternatesBundleKeys.ALTERNATES);
        for (int j=0; j < alternatesArr.length && altList.size() < MAX_ALT_LIST_LENGTH; j++) {
          Bundle alternateBundle=(Bundle)alternatesArr[j];
          String alternate=alternateBundle.getString(AlternatesBundleKeys.TEXT);
          if (!altList.contains(alternate)) {
            altList.add(alternate);
          }
        }
      }
    }
  }
  if (results.size() > 5) {
    results=results.subList(0,5);
  }
  mUiListener.onVoiceResults(results,alternatives);
  mRecognitionView.finish();
}
 

Example 34

From project AquaNotesTest, under directory /src/com/google/android/apps/iosched/ui/widget/.

Source file: Workspace.java

  29 
vote

@Override protected void onRestoreInstanceState(Parcelable state){
  SavedState savedState=(SavedState)state;
  super.onRestoreInstanceState(savedState.getSuperState());
  if (savedState.currentScreen != -1) {
    snapToScreen(savedState.currentScreen,true,true);
  }
}
 

Example 35

From project Bitcoin-Wallet-for-Android, under directory /wallet/src/de/schildbach/wallet/ui/.

Source file: CurrencyAmountView.java

  29 
vote

@Override protected Parcelable onSaveInstanceState(){
  final Bundle state=new Bundle();
  state.putParcelable("super_state",super.onSaveInstanceState());
  state.putSerializable("amount",getAmount());
  return state;
}
 

Example 36

From project BreizhCamp-android, under directory /src/org/breizhjug/breizhcamp/view/.

Source file: CustomGallery.java

  29 
vote

/** 
 * Restore the previous saved current screen
 */
@Override protected void onRestoreInstanceState(Parcelable state){
  SavedState savedState=(SavedState)state;
  super.onRestoreInstanceState(savedState.getSuperState());
  if (savedState.currentScreen != -1) {
    currentScreen=savedState.currentScreen;
  }
}
 

Example 37

From project conference-mobile-app, under directory /android-app/src/com/google/android/apps/iosched/ui/widget/.

Source file: Workspace.java

  29 
vote

@Override protected void onRestoreInstanceState(Parcelable state){
  SavedState savedState=(SavedState)state;
  super.onRestoreInstanceState(savedState.getSuperState());
  if (savedState.currentScreen != -1) {
    snapToScreen(savedState.currentScreen,true,true);
  }
}
 

Example 38

From project cornerstone, under directory /frameworks/base/core/java/android/app/.

Source file: ActivityManagerNative.java

  29 
vote

public int startActivity(IApplicationThread caller,Intent intent,String resolvedType,Uri[] grantedUriPermissions,int grantedMode,IBinder resultTo,String resultWho,int requestCode,boolean onlyIfNeeded,boolean debug,String profileFile,ParcelFileDescriptor profileFd,boolean autoStopProfiler) throws RemoteException {
  Parcel data=Parcel.obtain();
  Parcel reply=Parcel.obtain();
  data.writeInterfaceToken(IActivityManager.descriptor);
  data.writeStrongBinder(caller != null ? caller.asBinder() : null);
  intent.writeToParcel(data,0);
  data.writeString(resolvedType);
  data.writeTypedArray(grantedUriPermissions,0);
  data.writeInt(grantedMode);
  data.writeStrongBinder(resultTo);
  data.writeString(resultWho);
  data.writeInt(requestCode);
  data.writeInt(onlyIfNeeded ? 1 : 0);
  data.writeInt(debug ? 1 : 0);
  data.writeString(profileFile);
  if (profileFd != null) {
    data.writeInt(1);
    profileFd.writeToParcel(data,Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
  }
 else {
    data.writeInt(0);
  }
  data.writeInt(autoStopProfiler ? 1 : 0);
  mRemote.transact(START_ACTIVITY_TRANSACTION,data,reply,0);
  reply.readException();
  int result=reply.readInt();
  reply.recycle();
  data.recycle();
  return result;
}
 

Example 39

From project cw-advandroid, under directory /Views/ColorMixer/src/com/commonsware/android/colormixer/.

Source file: ColorMixer.java

  29 
vote

@Override public Parcelable onSaveInstanceState(){
  Bundle state=new Bundle();
  state.putParcelable(SUPERSTATE,super.onSaveInstanceState());
  state.putInt(COLOR,getColor());
  return (state);
}
 

Example 40

From project dcnyc10-android, under directory /android/src/com/lullabot/android/apps/iosched/ui/widget/.

Source file: Workspace.java

  29 
vote

@Override protected void onRestoreInstanceState(Parcelable state){
  SavedState savedState=(SavedState)state;
  super.onRestoreInstanceState(savedState.getSuperState());
  if (savedState.currentScreen != -1) {
    snapToScreen(savedState.currentScreen,true,true);
  }
}
 

Example 41

From project devoxx-france-android-in-fine, under directory /src/com/infine/android/devoxx/ui/widget/.

Source file: Workspace.java

  29 
vote

@Override protected void onRestoreInstanceState(Parcelable state){
  SavedState savedState=(SavedState)state;
  super.onRestoreInstanceState(savedState.getSuperState());
  if (savedState.currentScreen != -1) {
    snapToScreen(savedState.currentScreen,true,true);
  }
}