Losing data when rotate screen

//Use onSaveInstanceState(Bundle) and onRestoreInstanceState @Override public void onSaveInstanceState(Bundle savedInstanceState) { // Save UI state changes to the savedInstanceState. // This bundle will be passed to onCreate if the process is // killed and restarted. savedInstanceState.putBoolean(“MyBoolean”, true); savedInstanceState.putDouble(“myDouble”, 1.9); savedInstanceState.putInt(“MyInt”, 1); savedInstanceState.putString(“MyString”, “Welcome back to Android”); // etc. super.onSaveInstanceState(savedInstanceState); } //onRestoreInstanceState @Override public void onRestoreInstanceState(Bundle savedInstanceState) … Read more

How to increase the rotation speed in android?

Setting duration and/or repeat count did not help me with an indeterminate ProgressBar animation. I had to increase the toDegrees to have it make additional loops: <rotate xmlns:android=”http://schemas.android.com/apk/res/android” android:drawable=”@drawable/ic_indeterminate_progress” android:duration=”1″ android:fromDegrees=”0″ android:pivotX=”50%” android:pivotY=”50%” android:toDegrees=”1080″ /> <!–1080 is 3 loops instead of 1 in same amt of time–>

CGAffineTransform Reset

If you are trying to reset the transformation, so that the image appears as it did originally, you can simply set the transform back to the identity. self.imageView.transform = CGAffineTransformIdentity If you want to apply arbitrary transformations to the transformed image, the easiest thing to do would be to use the CGAffineTransform methods that take … Read more

Component of a quaternion rotation around an axis

There is an elegant solution for this problem, specially suited for quaternions. It is known as the “swing twist decomposition”: in pseudocode /** Decompose the rotation on to 2 parts. 1. Twist – rotation around the “direction” vector 2. Swing – rotation around axis that is perpendicular to “direction” vector The rotation can be composed … Read more

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