I found the comment on Activity#onConfigurationChanged method.
If I do not set the activity element's configChanged attribute, then
the System will restart my activity.

But again, how should I override this method, just add a empty method
body there?

Thanks.
    /**
     * Called by the system when the device configuration changes
while your
     * activity is running.  Note that this will <em>only</em> be
called if
     * you have selected configurations you would like to handle with
the
     * {...@link android.R.attr#configChanges} attribute in your
manifest.  If
     * any configuration change occurs that is not selected to be
reported
     * by that attribute, then instead of reporting it the system will
stop
     * and restart the activity (to have it launched with the new
     * configuration).
     *
     * <p>At the time that this function has been called, your
Resources
     * object will have been updated to return resource values
matching the
     * new configuration.
     *
     * @param newConfig The new device configuration.
     */
    public void onConfigurationChanged(Configuration newConfig) {

On Jun 16, 8:36 pm, zhangxiyuan <zhangzho...@gmail.com> wrote:
> Hi,
>
> I have posted this topic in the android-platform group, I do not know
> whether it is right or not to post it here.
> If not, just forget about it.
> Sorry.
>
> I have read the topic about "Controlling the Emulator" at
> developer.android.com.
> I can change my emulator's orientation by pressing CTRL+F11 or CTRL
> +F12.
>
> But what I really want to know is what this influence/affect my
> application.
> For example, I got an Activity with two screen. (main screen and
> settings screen)
> I am using a FrameLayout.
> When I press a button on the main screen, it rotates to the settings
> screen.
> then, If I press CTRL+F11, THEN it backs to the main screen.
> by debugging the application, I found that the activity's onCreate was
> invoked again, which means the activity was rebuilt.
> You know, I do not want this to happen.
> I want to change the orientation ,and keep the settings screen on
> foreground.
> How should I implement this?
>
> Thanks so much.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"android-framework" group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to