Android - unwanted submenu appearing after screen rotation -


I've created a very easy demo project to display the bug:

  import android .app .activity; Importroid.os.Bundle; Import android.view.Menu; Import android.view.MenuInflater; Public Category MenuBugActivity Extension Activity {@Override Creatives on Public Zero (Bundled Saved Instance) {super.onCreate (SavedInstanceState); SetContentView (R.layout.main); } @ Override Public Boolean On Crate Option Menu (menu menu) {MenuInflater inflater = New menu inflator (this); Inflater.inflate (R.Menu.points_bug_dimo, menu); Back true; }}  

Main Layout - main.xml:

  & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; LinearLayout xmlns: Android = "http://schemas.android.com/apk/res/android" Android: layout_width = "fill_parent" Android: layout_height = "fill_parent" />  

Menu item options_bug_demo.xml:

  & lt; Menu xmlns: android = "http://schemas.android.com/apk/res/android" & Gt; & Lt; Item android: id = "@ + id / menu_bug" Android: title = "bug" Android: icon = "@ drawable / ic_action_settings" Android: ShowAsaction = "always" & gt; & Lt; Menu & gt; & Lt; Android Android: id = "@ + id / menu_bug_demo" Android: title = "bug demo" & gt; & Lt; Menu & gt; & Lt; Item Android: Title = "Settings" /> & Lt; / Menu & gt; & Lt; / Item & gt; & Lt; / Menu & gt; & Lt; / Item & gt; & Lt; / Menu & gt;  

1. Click on the "Preferences" icon: Clicking & quot; ; Preferences & quot; Icon 2. Click on 3. " Setting "click": & quot; setting & quot;

submenu "settings" (Closed at step 3) The screen appears again after rotation! The only way to prevent submenu from appearing after rotation is to remove the string from the resource file

  android: id = "@ + id / menu_bug_demo"  

Options_bug_demo.xml

The question of avoiding this unwanted behavior of the submenu?

The PS bug was viewed at 4.0.4 and 4.1.1 and not seen at 4.4.2


Comments

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -