Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error in Android "SuperNotCalledException:Activity did not call through to super.OnCreate()"

Tags:

android

uncaught handler:thread main exiting due to uncaught exception android.app.SuperNotCalledException:Activity did not call through to super.OnCreate()

My Code is:

  public void onCreate(Bundle savedInstanceState) {
        boolean isEnabled = Settings.System.getInt(this.getApplicationContext().getContentResolver(),Settings.System.AIRPLANE_MODE_ON, 0) == 1;


                Settings.System.putInt(this.getApplicationContext().getContentResolver(),Settings.System.AIRPLANE_MODE_ON, isEnabled ? 0 : 1);

                // Post an intent to reload
                Intent intent = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED);
                //intent.putExtra("state",! isEnabled);//Call ON
                try {
                    Thread.sleep(15000);
                } catch (InterruptedException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
                intent.putExtra("state", isEnabled);
                                                                                           this.getApplicationContext().sendBroadcast(intent);


}
like image 959
David Prun Avatar asked Jul 15 '10 22:07

David Prun


2 Answers

Add super.onCreate(savedInstanceState);

 public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
        boolean isEnabled = Settings.System.getInt(this.getApplicationContext().getContentResolver(),Settings.System.AIRPLANE_MODE_ON, 0) == 1;
...
...
...
like image 170
Jorgesys Avatar answered Nov 08 '22 13:11

Jorgesys


add below code in manifest of corresponding activity

  android:screenOrientation="fullSensor"

This issue happen with 8.0 version with Activity full screen and dialog activity

like image 33
Revan siddappa Avatar answered Nov 08 '22 12:11

Revan siddappa