Verständnisfrage - Display-Orientierung

  • 1 Antworten
  • Letztes Antwortdatum
H

husvun41

Gast
Ob sich die Geräteorientierung ändert kann man ja per OrientationEventListener feststellen.

Soweit so gut.
Wieso wird aber das Layout dnnoch bei jeder Änderung der Geräteorientierung neu aufgebaut? :confused:

mfg
-yeah
 
Zuletzt bearbeitet von einem Moderator:
Soweit ich weiß erstellt der doch die komplette Activity neu.
http://stackoverflow.com/questions/5913130/dont-reload-application-when-orientation-changes
1. Antwort 3. Vorschlag ist wohl das einfachste um das zu 'verhindern'

Und zu dem warum - ist relativ logisch bzw. Praktisch:
" This is done because any application resource, including layout files, can change based on any configuration value. Thus the only safe way to handle a configuration change is to re-retrieve all resources, including layouts, drawables, and strings. Because activities must already know how to save their state and re-create themselves from that state, this is a convenient way to have an activity restart itself with a new configuration"

Siehe http://developer.android.com/refere...ty.html#onSaveInstanceState(android.os.Bundle)

Greets,
Max
 
Zuletzt bearbeitet:
Zurück
Oben Unten