java - Screen dims and requires extra back button press after returning from PreferenceActivity -


I've added a simple choice for my app, which is accessible through a context menu button. I can cure the use of priority, and everything works there. The problem occurs when you leave preferences through the back button. The main activity of the app reappears, but then the whole screen is dimmed, there is almost one dialog that popped up or the context menu did not disappear, but it is not so.

Why do anybody have such an idea why this happens?

Main Activity: @ Override Public Boolean On Crate Option Menu (Menu Menu) {Super. Secret Options Menu (menu); // Infoletter MenuInflater inflater = getMenuInflater (); // inflater.inflate (R. menu.main_menu, menu); Back true; }

@ Override public boolean on option etam selected (menu item) {// handle item selection; Switch (item.getItemId ()) {Case RID Refresh: Refresh (); Back true; Case R.id.subreddits: startActivity (new intent (this, Prefs.class)); Back true; Default: Return Super.Options item selected (item); }}

Priority:

  @ override protected form zero (bundle savedinstenstate) {super.onCreate (savedInstanceState); AddPreferencesFromResource (R.xml.subreddit_preferences); }    

I will not write on onCreateOptionsMenu () Instead of calling super instead of returning to true , return the results of the series to a super-class.

If it does not help, it uses Preferences and does not suffer from the problems you quoted, see if you can find out that your code is with me What is this.

Comments