Must be called from {@link View#onSaveInstanceState()}
420119
@Override public Parcelable onSaveInstanceState() {
    if (isInEditMode) return null;

    VS viewState = delegateCallback.getViewState();
    if (viewState == null) {
      throw new NullPointerException("ViewState returned from getViewState() is null for MvpView "
          + delegateCallback.getMvpView());
    }

    Parcelable superState = delegateCallback.superOnSaveInstanceState();

    if (keepPresenterDuringScreenOrientationChange) {
      if (viewState instanceof RestorableParcelableViewState) {
        return new MosbyViewStateSavedState(superState, mosbyViewId,
            (RestorableParcelableViewState) viewState);
      }
      return new MosbyViewStateSavedState(superState, mosbyViewId, null);
    } else {
      return superState;
    }
  }
97455
@Override
	public void onCreate(final Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		// Setup base map
		rl = new RelativeLayout(this);

		this.mMapView = new MapView(this);
		this.mMapView.setTilesScaledToDpi(true);
		rl.addView(this.mMapView, new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT,
				LayoutParams.FILL_PARENT));
		this.mMapView.setBuiltInZoomControls(true);

		// zoom to the netherlands
		this.mMapView.getController().setZoom(7);
		this.mMapView.getController().setCenter(new GeoPoint(51500000, 5400000));

		// Add tiles layer
		mProvider = new MapTileProviderBasic(getApplicationContext());
		mProvider.setTileSource(TileSourceFactory.FIETS_OVERLAY_NL);
		this.mTilesOverlay = new TilesOverlay(mProvider, this.getBaseContext());
		this.mMapView.getOverlays().add(this.mTilesOverlay);

		this.setContentView(rl);
	}
1244559
@Override
    protected void onCreate(Bundle savedInstanceState)
    {
        setTheme(SampleList.THEME); //Used for theme switching in samples
        // Be sure to call the super class.
        super.onCreate(savedInstanceState);

        // See assets/res/any/layout/hello_world.xml for this
        // view layout definition, which is being set here as
        // the content of our screen.
        setContentView(R.layout.send_result);

        // Watch for button clicks.
        Button button = (Button)findViewById(R.id.corky);
        button.setOnClickListener(mCorkyListener);
        button = (Button)findViewById(R.id.violet);
        button.setOnClickListener(mVioletListener);
    }
942249
public void onRestoreInstanceState(Bundle presenterState) {
        if (presenter != null)
            throw new IllegalArgumentException("onRestoreInstanceState() should be called before onResume()");
        this.bundle = ParcelFn.unmarshall(ParcelFn.marshall(presenterState));
    }
547236
@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_page_objects_home);
    }
563401
@MainThread
    private void subscribeViewStateConsumerActually(@NonNull final V view) {

        if (view == null) {
            throw new NullPointerException("View is null");
        }

        if (viewStateConsumer == null) {
            throw new NullPointerException(ViewStateConsumer.class.getSimpleName()
                    + " is null. This is a Mosby internal bug. Please file an issue at https://github.com/sockeqwe/mosby/issues");
        }

        viewRelayConsumerDisposable = viewStateBehaviorSubject.subscribe(new Consumer<VS>() {
            @Override
            public void accept(VS vs) throws Exception {
                viewStateConsumer.accept(view, vs);
            }
        });
    }
265426
public void onResume(Object view) {
        getPresenter();
        if (presenter != null && !presenterHasView) {
            //noinspection unchecked
            presenter.takeView(view);
            presenterHasView = true;
        }
    }
1314695
@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        // storing string resources into Array
        String[] pages = getResources().getStringArray(R.array.pages);

        // Binding resources Array to ListAdapter
        this.setListAdapter(new ArrayAdapter<String>(this, R.layout.list_item, R.id.label, pages));

        ListView lv = getListView();

        // listening to single list item on click
        lv.setOnItemClickListener(new OnItemClickListener() {
          public void onItemClick(AdapterView<?> parent, View view,
              int position, long id) {
              // selected item
              String product = ((TextView) view).getText().toString();

              // Launching new Activity on selecting single List Item
              Intent i = new Intent(getApplicationContext(), TestActivity.class);
              i.putExtra("product", product.concat(" page"));

              if (product.equals("WebView")) {
                  i = new Intent(getApplicationContext(), WebviewActivity.class);
              } else if (product.equals("Notification")) {
                  // generate a notification instead of starting a new activity
                  NotificationManager notificationManager = (NotificationManager)
                          getSystemService(NOTIFICATION_SERVICE);

                  PendingIntent pIntent = PendingIntent.getActivity(getApplicationContext(), 0, i, 0);

                  Notification n  = new Notification.Builder(getApplicationContext())
                          .setContentTitle(getString(R.string.notification_title))
                          .setContentText(getString(R.string.notification_text))
                          .setContentIntent(pIntent)
                          .setSmallIcon(android.R.drawable.ic_dialog_alert)
                          .setAutoCancel(true).build();

                  notificationManager.notify(0, n);
                  System.out.println("HelloWorld:: Sending notification");

                  return;
              }

              // sending data to new activity
              startActivity(i);
          }
        });
    }
735834
@Override
	public void onViewCreated(View view, Bundle savedInstanceState) {
	
		super.onViewCreated(view, savedInstanceState);
		EventUtils.link(EVENT_CONFIGURATION);
	}
934898
public void onSaveInstanceState(Bundle outState) {
    int bottomSheetBehaviorState = summaryBehavior == null ? INVALID_STATE : summaryBehavior.getState();
    boolean isWayNameVisible = wayNameView.getVisibility() == VISIBLE;
    NavigationViewInstanceState navigationViewInstanceState = new NavigationViewInstanceState(
      bottomSheetBehaviorState, recenterBtn.getVisibility(), instructionView.isShowingInstructionList(),
      isWayNameVisible, wayNameView.retrieveWayNameText(), navigationViewModel.isMuted());
    String instanceKey = getContext().getString(R.string.navigation_view_instance_state);
    outState.putParcelable(instanceKey, navigationViewInstanceState);
    outState.putBoolean(getContext().getString(R.string.navigation_running), navigationViewModel.isRunning());
    mapView.onSaveInstanceState(outState);
    saveNavigationMapInstanceState(outState);
  }
474048
public void onSaveInstanceState(Bundle outState) {
    if (state != State.IDLE) {
      throw new IllegalStateException("Cannot handle onSaveInstanceState while " + state);
    }
    rootBundle = outState;

    state = State.SAVING;

    // Make a dwindling copy of the services, in case one is deleted as a side effect
    // of another's onSave.
    List<Map.Entry<String, BundleService>> servicesToBeSaved =
        new ArrayList<>(scopedServices.entrySet());

    while (!servicesToBeSaved.isEmpty()) {
      Map.Entry<String, BundleService> entry = servicesToBeSaved.remove(0);
      if (scopedServices.containsKey(entry.getKey())) entry.getValue().saveToRootBundle(rootBundle);
    }

    state = State.IDLE;
  }
1071366
@Override
	public void onDetach(MapView mapView) {
		BitmapPool.getInstance().asyncRecycle(mIcon);
		mIcon=null;
		BitmapPool.getInstance().asyncRecycle(mImage);
		//cleanDefaults();
		this.mOnMarkerClickListener=null;
		this.mOnMarkerDragListener=null;
		this.mResources=null;
		setRelatedObject(null);
		if (isInfoWindowShown())
			closeInfoWindow();
		//	//if we're using the shared info window, this will cause all instances to close

		mMapViewRepository = null;
		setInfoWindow(null);
		onDestroy();


        super.onDetach(mapView);
    }
905630
public static void putViewState(@NonNull Activity activity, @NonNull String viewId,
      @NonNull Object viewState) {
    if (activity == null) {
      throw new NullPointerException("Activity is null");
    }

    ActivityScopedCache scopedCache = getOrCreateActivityScopedCache(activity);
    scopedCache.putViewState(viewId, viewState);
  }
1316374
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Fragment fragment = getSupportFragmentManager().findFragmentById(android.R.id.content);
        if (fragment == null) {
            fragment = MainFragment.newInstance(getIntent().getExtras());
            getSupportFragmentManager()
                    .beginTransaction()
                    .replace(android.R.id.content, fragment, "")
                    .commit();
        } else {
            getSupportFragmentManager()
                    .beginTransaction()
                    .attach(fragment)
                    .commit();
        }
    }
964103
@Override
    public void onNewState(CrawlerContext context, StateVertex vertex) {
        LOG.debug("onNewState");
        StateBuilder state = outModelCache.addStateIfAbsent(vertex);
        visitedStates.putIfAbsent(state.getName(), vertex);

        saveScreenshot(context.getBrowser(), state.getName(), vertex);

        outputBuilder.persistDom(state.getName(), context.getBrowser().getUnStrippedDom());
    }
255462
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_changelog);

        mAppbar = ButterKnife.findById(this, R.id.appbar);
        mContainer = ButterKnife.findById(this, R.id.container);

        configAppBar();
        parseExtras(savedInstanceState);
    }
57242
@Override
    protected void onPostCreate(Bundle savedInstanceState) {
        super.onPostCreate(savedInstanceState);
        // Sync the toggle state after onRestoreInstanceState has occurred.
        if(pulsante != null )
            pulsante.syncState();
    }