android - how to define the screen orientation before the activity is created? -
i defined activity in portrait mode : android:screenorientation="portrait"
when take picture camera function via intent, take picture in landscape mode , turn screen portrait mode when saving it, return activity again. dont understand is, activity short time in landscape mode, destroyed , built again in portrait mode... oncreate ond onrestore functions need time, waiting time user doubled...
is there workaround or else?
you can register activity explicitly handle orientation changes adding android:configchanges="orientation"
activity definition , overriding oncofigurationchanged method in activity this:
@override public void onconfigurationchanged(configuration newconfig) { super.onconfigurationchanged(newconfig); setrequestedorientation(activityinfo.screen_orientation_portrait); }
i'm not sure if specific problem, remember doing when wanted activity display in portrait mode. let me know if helps :)
Comments
Post a Comment