How to prevent custom views from losing state across screen orientation changes

I think this is a much simpler version. Bundle is a built-in type which implements Parcelable public class CustomView extends View { private int stuff; // stuff @Override public Parcelable onSaveInstanceState() { Bundle bundle = new Bundle(); bundle.putParcelable(“superState”, super.onSaveInstanceState()); bundle.putInt(“stuff”, this.stuff); // … save stuff return bundle; } @Override public void onRestoreInstanceState(Parcelable state) { if … Read more

I want my android application to be only run in portrait mode?

In the manifest, set this for all your activities: <activity android:name=”.YourActivity” android:configChanges=”orientation” android:screenOrientation=”portrait”/> Let me explain: With android:configChanges=”orientation” you tell Android that you will be responsible of the changes of orientation. android:screenOrientation=”portrait” you set the default orientation mode.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)