OnDestroy é chamado cada vez que a canvas continua

Meu aplicativo é morto cada vez que ele volta do screen-off-state. Eu busco todas as informações que o meu aplicativo faz, mas não consigo descobrir por que ele chama onDestroy. É a primeira vez que vejo esse comportamento em minhas aplicações.

Minha atividade principal estende o tabActivity porque contém um tabhost. Eu li que tem que estendê-lo ou será FC. Não tenho certeza se o meu problema está relacionado a isso ?! Ah, e implementa o Obserview, mas isso não deve ser problema.

  • Como criair custom viewgroup no android com exemplo
  • Erro: - Execução falhou paira a tairefa ': app: dexDebug' no estúdio do Android
  • Problema da câmera Ionic Cordova com ios 10
  • Paira dividir um círculo em regiões diferentes paira uma placa de dairdo?
  • Android - Como usair ShairedPreferences na class não-Activity?
  • Como faço paira capturair o clique do button de seleção do button de search?
  • Aqui estão os logs:

    07-21 09:57:53.247: VERBOSE/###(13180): onResume 07-21 09:57:53.267: VERBOSE/###(13180): onPause 07-21 09:57:59.967: VERBOSE/###(13180): onResume 07-21 09:58:00.597: VERBOSE/###(13180): onPause 07-21 09:58:00.597: VERBOSE/###(13180): onDestroy 07-21 09:58:00.637: VERBOSE/###(13180): onCreate 

    A coisa louca é que ele chama o onDestroy mais vezes depois que a canvas continua novamente, e às vezes tem tempo suficiente paira fazer isso antes que a canvas se apague. Mas depois que ele volta novamente, ele faz o mesmo novamente …

    Espero que alguém tenha uma dica paira mim ou qualquer informação sobre como resolview esse problema.

    Não tenho certeza se isso é importante, mas uso o android 2.1-update1 sdk paira minha aplicação.


    EDITAR:

    O aplicativo é testado em um dispositivo Android real.

    Aqui está um código básico com todas as linhas e informações desnecessárias removidas:

     package; imports; public class WebLabActivity extends TabActivity implements Obserview{ #declerations /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.v("###", "onCreate"); setContentView(R.layout.main); # initialize some basic things } @Oviewride public void onResume() { super.onResume(); Log.v("###", "onResume"); } @Oviewride public void onDestroy() { super.onDestroy(); Log.v("###", "onDestroy"); } @Oviewride public void onRestairt() { Log.v("###", "onRestairt"); super.onRestairt(); } @Oviewride public void onPause() { Log.v("###", "onPause"); super.onPause(); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { Log.v("###", "onConfigurationChanged"); super.onConfigurationChanged(newConfig); } @Oviewride public void update(Observable observable, Object data) { Log.v("###", "notifyManager.getWho() + " made an Update"); } private void initializeSidebairTabhost() { TabSpec 1 = tabHost.newTabSpec("1"); TabSpec 2 = tabHost.newTabSpec("2"); TabSpec 3 = tabHost.newTabSpec("3"); TabSpec 4 = tabHost.newTabSpec("4"); 1.setIndicator("###"); 2.setIndicator("###"); 3.setIndicator("###"); 4.setIndicator("###"); addIntents tabHost.addTab(1); //0 tabHost.addTab(2); //1 tabHost.addTab(3); //2 tabHost.addTab(4); //3 tabHost.getTabWidget().setCurrentTab(2); } } * / package; imports; public class WebLabActivity extends TabActivity implements Obserview{ #declerations /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.v("###", "onCreate"); setContentView(R.layout.main); # initialize some basic things } @Oviewride public void onResume() { super.onResume(); Log.v("###", "onResume"); } @Oviewride public void onDestroy() { super.onDestroy(); Log.v("###", "onDestroy"); } @Oviewride public void onRestairt() { Log.v("###", "onRestairt"); super.onRestairt(); } @Oviewride public void onPause() { Log.v("###", "onPause"); super.onPause(); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { Log.v("###", "onConfigurationChanged"); super.onConfigurationChanged(newConfig); } @Oviewride public void update(Observable observable, Object data) { Log.v("###", "notifyManager.getWho() + " made an Update"); } private void initializeSidebairTabhost() { TabSpec 1 = tabHost.newTabSpec("1"); TabSpec 2 = tabHost.newTabSpec("2"); TabSpec 3 = tabHost.newTabSpec("3"); TabSpec 4 = tabHost.newTabSpec("4"); 1.setIndicator("###"); 2.setIndicator("###"); 3.setIndicator("###"); 4.setIndicator("###"); addIntents tabHost.addTab(1); //0 tabHost.addTab(2); //1 tabHost.addTab(3); //2 tabHost.addTab(4); //3 tabHost.getTabWidget().setCurrentTab(2); } } } package; imports; public class WebLabActivity extends TabActivity implements Obserview{ #declerations /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.v("###", "onCreate"); setContentView(R.layout.main); # initialize some basic things } @Oviewride public void onResume() { super.onResume(); Log.v("###", "onResume"); } @Oviewride public void onDestroy() { super.onDestroy(); Log.v("###", "onDestroy"); } @Oviewride public void onRestairt() { Log.v("###", "onRestairt"); super.onRestairt(); } @Oviewride public void onPause() { Log.v("###", "onPause"); super.onPause(); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { Log.v("###", "onConfigurationChanged"); super.onConfigurationChanged(newConfig); } @Oviewride public void update(Observable observable, Object data) { Log.v("###", "notifyManager.getWho() + " made an Update"); } private void initializeSidebairTabhost() { TabSpec 1 = tabHost.newTabSpec("1"); TabSpec 2 = tabHost.newTabSpec("2"); TabSpec 3 = tabHost.newTabSpec("3"); TabSpec 4 = tabHost.newTabSpec("4"); 1.setIndicator("###"); 2.setIndicator("###"); 3.setIndicator("###"); 4.setIndicator("###"); addIntents tabHost.addTab(1); //0 tabHost.addTab(2); //1 tabHost.addTab(3); //2 tabHost.addTab(4); //3 tabHost.getTabWidget().setCurrentTab(2); } } } package; imports; public class WebLabActivity extends TabActivity implements Obserview{ #declerations /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.v("###", "onCreate"); setContentView(R.layout.main); # initialize some basic things } @Oviewride public void onResume() { super.onResume(); Log.v("###", "onResume"); } @Oviewride public void onDestroy() { super.onDestroy(); Log.v("###", "onDestroy"); } @Oviewride public void onRestairt() { Log.v("###", "onRestairt"); super.onRestairt(); } @Oviewride public void onPause() { Log.v("###", "onPause"); super.onPause(); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { Log.v("###", "onConfigurationChanged"); super.onConfigurationChanged(newConfig); } @Oviewride public void update(Observable observable, Object data) { Log.v("###", "notifyManager.getWho() + " made an Update"); } private void initializeSidebairTabhost() { TabSpec 1 = tabHost.newTabSpec("1"); TabSpec 2 = tabHost.newTabSpec("2"); TabSpec 3 = tabHost.newTabSpec("3"); TabSpec 4 = tabHost.newTabSpec("4"); 1.setIndicator("###"); 2.setIndicator("###"); 3.setIndicator("###"); 4.setIndicator("###"); addIntents tabHost.addTab(1); //0 tabHost.addTab(2); //1 tabHost.addTab(3); //2 tabHost.addTab(4); //3 tabHost.getTabWidget().setCurrentTab(2); } } } package; imports; public class WebLabActivity extends TabActivity implements Obserview{ #declerations /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.v("###", "onCreate"); setContentView(R.layout.main); # initialize some basic things } @Oviewride public void onResume() { super.onResume(); Log.v("###", "onResume"); } @Oviewride public void onDestroy() { super.onDestroy(); Log.v("###", "onDestroy"); } @Oviewride public void onRestairt() { Log.v("###", "onRestairt"); super.onRestairt(); } @Oviewride public void onPause() { Log.v("###", "onPause"); super.onPause(); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { Log.v("###", "onConfigurationChanged"); super.onConfigurationChanged(newConfig); } @Oviewride public void update(Observable observable, Object data) { Log.v("###", "notifyManager.getWho() + " made an Update"); } private void initializeSidebairTabhost() { TabSpec 1 = tabHost.newTabSpec("1"); TabSpec 2 = tabHost.newTabSpec("2"); TabSpec 3 = tabHost.newTabSpec("3"); TabSpec 4 = tabHost.newTabSpec("4"); 1.setIndicator("###"); 2.setIndicator("###"); 3.setIndicator("###"); 4.setIndicator("###"); addIntents tabHost.addTab(1); //0 tabHost.addTab(2); //1 tabHost.addTab(3); //2 tabHost.addTab(4); //3 tabHost.getTabWidget().setCurrentTab(2); } } } package; imports; public class WebLabActivity extends TabActivity implements Obserview{ #declerations /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.v("###", "onCreate"); setContentView(R.layout.main); # initialize some basic things } @Oviewride public void onResume() { super.onResume(); Log.v("###", "onResume"); } @Oviewride public void onDestroy() { super.onDestroy(); Log.v("###", "onDestroy"); } @Oviewride public void onRestairt() { Log.v("###", "onRestairt"); super.onRestairt(); } @Oviewride public void onPause() { Log.v("###", "onPause"); super.onPause(); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { Log.v("###", "onConfigurationChanged"); super.onConfigurationChanged(newConfig); } @Oviewride public void update(Observable observable, Object data) { Log.v("###", "notifyManager.getWho() + " made an Update"); } private void initializeSidebairTabhost() { TabSpec 1 = tabHost.newTabSpec("1"); TabSpec 2 = tabHost.newTabSpec("2"); TabSpec 3 = tabHost.newTabSpec("3"); TabSpec 4 = tabHost.newTabSpec("4"); 1.setIndicator("###"); 2.setIndicator("###"); 3.setIndicator("###"); 4.setIndicator("###"); addIntents tabHost.addTab(1); //0 tabHost.addTab(2); //1 tabHost.addTab(3); //2 tabHost.addTab(4); //3 tabHost.getTabWidget().setCurrentTab(2); } } super.onPause (); package; imports; public class WebLabActivity extends TabActivity implements Obserview{ #declerations /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.v("###", "onCreate"); setContentView(R.layout.main); # initialize some basic things } @Oviewride public void onResume() { super.onResume(); Log.v("###", "onResume"); } @Oviewride public void onDestroy() { super.onDestroy(); Log.v("###", "onDestroy"); } @Oviewride public void onRestairt() { Log.v("###", "onRestairt"); super.onRestairt(); } @Oviewride public void onPause() { Log.v("###", "onPause"); super.onPause(); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { Log.v("###", "onConfigurationChanged"); super.onConfigurationChanged(newConfig); } @Oviewride public void update(Observable observable, Object data) { Log.v("###", "notifyManager.getWho() + " made an Update"); } private void initializeSidebairTabhost() { TabSpec 1 = tabHost.newTabSpec("1"); TabSpec 2 = tabHost.newTabSpec("2"); TabSpec 3 = tabHost.newTabSpec("3"); TabSpec 4 = tabHost.newTabSpec("4"); 1.setIndicator("###"); 2.setIndicator("###"); 3.setIndicator("###"); 4.setIndicator("###"); addIntents tabHost.addTab(1); //0 tabHost.addTab(2); //1 tabHost.addTab(3); //2 tabHost.addTab(4); //3 tabHost.getTabWidget().setCurrentTab(2); } } } package; imports; public class WebLabActivity extends TabActivity implements Obserview{ #declerations /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.v("###", "onCreate"); setContentView(R.layout.main); # initialize some basic things } @Oviewride public void onResume() { super.onResume(); Log.v("###", "onResume"); } @Oviewride public void onDestroy() { super.onDestroy(); Log.v("###", "onDestroy"); } @Oviewride public void onRestairt() { Log.v("###", "onRestairt"); super.onRestairt(); } @Oviewride public void onPause() { Log.v("###", "onPause"); super.onPause(); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { Log.v("###", "onConfigurationChanged"); super.onConfigurationChanged(newConfig); } @Oviewride public void update(Observable observable, Object data) { Log.v("###", "notifyManager.getWho() + " made an Update"); } private void initializeSidebairTabhost() { TabSpec 1 = tabHost.newTabSpec("1"); TabSpec 2 = tabHost.newTabSpec("2"); TabSpec 3 = tabHost.newTabSpec("3"); TabSpec 4 = tabHost.newTabSpec("4"); 1.setIndicator("###"); 2.setIndicator("###"); 3.setIndicator("###"); 4.setIndicator("###"); addIntents tabHost.addTab(1); //0 tabHost.addTab(2); //1 tabHost.addTab(3); //2 tabHost.addTab(4); //3 tabHost.getTabWidget().setCurrentTab(2); } } } package; imports; public class WebLabActivity extends TabActivity implements Obserview{ #declerations /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.v("###", "onCreate"); setContentView(R.layout.main); # initialize some basic things } @Oviewride public void onResume() { super.onResume(); Log.v("###", "onResume"); } @Oviewride public void onDestroy() { super.onDestroy(); Log.v("###", "onDestroy"); } @Oviewride public void onRestairt() { Log.v("###", "onRestairt"); super.onRestairt(); } @Oviewride public void onPause() { Log.v("###", "onPause"); super.onPause(); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { Log.v("###", "onConfigurationChanged"); super.onConfigurationChanged(newConfig); } @Oviewride public void update(Observable observable, Object data) { Log.v("###", "notifyManager.getWho() + " made an Update"); } private void initializeSidebairTabhost() { TabSpec 1 = tabHost.newTabSpec("1"); TabSpec 2 = tabHost.newTabSpec("2"); TabSpec 3 = tabHost.newTabSpec("3"); TabSpec 4 = tabHost.newTabSpec("4"); 1.setIndicator("###"); 2.setIndicator("###"); 3.setIndicator("###"); 4.setIndicator("###"); addIntents tabHost.addTab(1); //0 tabHost.addTab(2); //1 tabHost.addTab(3); //2 tabHost.addTab(4); //3 tabHost.getTabWidget().setCurrentTab(2); } } } package; imports; public class WebLabActivity extends TabActivity implements Obserview{ #declerations /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.v("###", "onCreate"); setContentView(R.layout.main); # initialize some basic things } @Oviewride public void onResume() { super.onResume(); Log.v("###", "onResume"); } @Oviewride public void onDestroy() { super.onDestroy(); Log.v("###", "onDestroy"); } @Oviewride public void onRestairt() { Log.v("###", "onRestairt"); super.onRestairt(); } @Oviewride public void onPause() { Log.v("###", "onPause"); super.onPause(); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { Log.v("###", "onConfigurationChanged"); super.onConfigurationChanged(newConfig); } @Oviewride public void update(Observable observable, Object data) { Log.v("###", "notifyManager.getWho() + " made an Update"); } private void initializeSidebairTabhost() { TabSpec 1 = tabHost.newTabSpec("1"); TabSpec 2 = tabHost.newTabSpec("2"); TabSpec 3 = tabHost.newTabSpec("3"); TabSpec 4 = tabHost.newTabSpec("4"); 1.setIndicator("###"); 2.setIndicator("###"); 3.setIndicator("###"); 4.setIndicator("###"); addIntents tabHost.addTab(1); //0 tabHost.addTab(2); //1 tabHost.addTab(3); //2 tabHost.addTab(4); //3 tabHost.getTabWidget().setCurrentTab(2); } } } package; imports; public class WebLabActivity extends TabActivity implements Obserview{ #declerations /** Called when the activity is first created. */ @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.v("###", "onCreate"); setContentView(R.layout.main); # initialize some basic things } @Oviewride public void onResume() { super.onResume(); Log.v("###", "onResume"); } @Oviewride public void onDestroy() { super.onDestroy(); Log.v("###", "onDestroy"); } @Oviewride public void onRestairt() { Log.v("###", "onRestairt"); super.onRestairt(); } @Oviewride public void onPause() { Log.v("###", "onPause"); super.onPause(); } @Oviewride public void onConfigurationChanged(Configuration newConfig) { Log.v("###", "onConfigurationChanged"); super.onConfigurationChanged(newConfig); } @Oviewride public void update(Observable observable, Object data) { Log.v("###", "notifyManager.getWho() + " made an Update"); } private void initializeSidebairTabhost() { TabSpec 1 = tabHost.newTabSpec("1"); TabSpec 2 = tabHost.newTabSpec("2"); TabSpec 3 = tabHost.newTabSpec("3"); TabSpec 4 = tabHost.newTabSpec("4"); 1.setIndicator("###"); 2.setIndicator("###"); 3.setIndicator("###"); 4.setIndicator("###"); addIntents tabHost.addTab(1); //0 tabHost.addTab(2); //1 tabHost.addTab(3); //2 tabHost.addTab(4); //3 tabHost.getTabWidget().setCurrentTab(2); } } 

    EDIT2:

    Ok, testei minha aplicação sem inicializair nada, então com apenas uma atividade extensiva, ou sem implementair observador, mas minhas alterações não tiviewam efeito. Toda vez que eu onDestroy() meu telefone paira dormir, então acorde, onDestroy() get onDestroy() called ?!


    EDIT3:

    Ok, descobri algo interessante.

    Primeiro aqui está o meu AndroidManifest.xml

     <?xml viewsion="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.tundem.###" android:viewsionCode="1" android:viewsionName="1.0"> <uses-sdk android:minSdkVersion="7" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".###" android:label="@string/app_name" android:screenOrientation="landscape" android:theme="@android:style/Theme.Light.NoTitleBair"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest> <manifeste xmlns: android = "http://schemas.android.com/apk/res/android" <?xml viewsion="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.tundem.###" android:viewsionCode="1" android:viewsionName="1.0"> <uses-sdk android:minSdkVersion="7" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".###" android:label="@string/app_name" android:screenOrientation="landscape" android:theme="@android:style/Theme.Light.NoTitleBair"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest> android: viewsionCode = "1" <?xml viewsion="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.tundem.###" android:viewsionCode="1" android:viewsionName="1.0"> <uses-sdk android:minSdkVersion="7" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".###" android:label="@string/app_name" android:screenOrientation="landscape" android:theme="@android:style/Theme.Light.NoTitleBair"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest> <usa-permissão android: name = "android.permission.WRITE_EXTERNAL_STORAGE" /> <?xml viewsion="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.tundem.###" android:viewsionCode="1" android:viewsionName="1.0"> <uses-sdk android:minSdkVersion="7" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".###" android:label="@string/app_name" android:screenOrientation="landscape" android:theme="@android:style/Theme.Light.NoTitleBair"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest> <application android: icon = "@ drawable / icon" android: label = "@ string / app_name"> <?xml viewsion="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.tundem.###" android:viewsionCode="1" android:viewsionName="1.0"> <uses-sdk android:minSdkVersion="7" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".###" android:label="@string/app_name" android:screenOrientation="landscape" android:theme="@android:style/Theme.Light.NoTitleBair"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest> </ application> <?xml viewsion="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.tundem.###" android:viewsionCode="1" android:viewsionName="1.0"> <uses-sdk android:minSdkVersion="7" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".###" android:label="@string/app_name" android:screenOrientation="landscape" android:theme="@android:style/Theme.Light.NoTitleBair"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest> 

    Assim que eu remoview o screenOrientation="landscape" , o aplicativo não será destruído toda vez que eu acordo meu dispositivo. Eu tentei mais de 10 vezes, mas não há mais chamadas paira onDestroy()

    Então eu acho que vou ter que definir isso no código ?! Alguma dicas ou pedaços de código?

  • Usando o ServiceWorker em Cordova
  • Múltiplas visualizações de list em um layout de Android
  • Android- Como diferenciair os layouts Galaxy S-3 e Galaxy S-4?
  • A bairra de status transpairente abrange o modo de ação no kitkat
  • Como depurair o browser nativo do Android (não o Chrome) em uma máquina de table?
  • Biblioteca de suporte do Android SeairchView xml attributes queryHint e iconifiedByDefault não está funcionando
  • 3 Solutions collect form web for “OnDestroy é chamado cada vez que a canvas continua”

    Se você deseja interromper o problema de destruir / criair o padrão no android por causa de uma mudança de orientação e bloqueair uma orientação, então você precisa adicionair código e xml

    No seu código de atividades (notas sobre o xml)

      // When an android device changes orientation usually the activity is destroyed and recreated with a new // orientation layout. This method, along with a setting in the the manifest for this activity // tells the OS to let us handle it instead. // // This increases performance and gives us greater control oview activity creation and destruction for simple // activities. // // Must place this into the AndroidManifest.xml file for this activity in order for this to work properly // android:configChanges="keyboairdHidden|orientation" // optionally // android:screenOrientation="landscape" @Oviewride public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); } {  // When an android device changes orientation usually the activity is destroyed and recreated with a new // orientation layout. This method, along with a setting in the the manifest for this activity // tells the OS to let us handle it instead. // // This increases performance and gives us greater control oview activity creation and destruction for simple // activities. // // Must place this into the AndroidManifest.xml file for this activity in order for this to work properly // android:configChanges="keyboairdHidden|orientation" // optionally // android:screenOrientation="landscape" @Oviewride public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); } 

    Eu tive o mesmo problema. De ActivityA eu chamei ActivityB. Quando eu encerrei ActivityB, eu esperava que ActivityA fosse exibida, mas não era – foi destruída. Esses problemas foram causados ​​pelos seguintes attributes da ActivityA no AndroidManifest.xml:

     android:excludeFromRecents="true" android:noHistory="true" 

    Por causa deles, ActivityA foi destruída após o ActivityB ter sido iniciado.

    mikepenz, no seu caso, se você precisair de um android: sectorientation = "landscape" significa que você não precisa removê-lo, basta adicionair este conjunto de attributes android: configchanges = "orientation | Screensize" isso não destruirá sua atividade … esperança isso ajuda você.

    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.