Commits

M Haidar Hanif committed e4c9a4b

Fix onSaveInstanceState issue

Now can restore changes onRestoreInstanceState.
Remember to use correct parameter in method call.
Check for correct variable declaration.

  • Participants
  • Parent commits 9db6110

Comments (0)

Files changed (1)

File src/com/mhaidarhanif/android/kargu/MainActivity.java

 
 public class MainActivity extends Activity {
 
-  public static final String EXTRA_NUMBER = "com.mhaidarhanif.android.kargu.NUMBER";
+  public static final String EXTRA_NUMBER = "NUMBER";
   private static Drawable sLogoKargu;
 
   // For complete title purpose. Will be used later
   // String appEditionName = getString(R.string.name_app) + " " + getString(R.string.name_edition);
   TextView mTextView; // Text view in layout
-  EditText mNumberInput; // First number input to fill
+  int mNumberInput; // First number input to fill
 
   @Override
   protected void onCreate(Bundle savedInstanceState) {
     super.onRestoreInstanceState(savedInstanceState);
 
     // Restore previous input number if apply
-    mNumberInput = savedInstanceState.putInt(EXTRA_NUMBER);
+    mNumberInput = savedInstanceState.getInt(EXTRA_NUMBER);
   }
 
   @Override