2010-07-15 9 views
10

gestore non rilevata: thread principale uscendo a causa di eccezione non identificata android.app.SuperNotCalledException: Attività non ha chiamata fino alla super.onCreate()Errore in Android "SuperNotCalledException: Attività non ha chiamato fino al super.onCreate()"

il mio codice è:

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); 


} 

risposta

22

Aggiungi 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; 
... 
... 
... 
Problemi correlati