ActionBar in the notification / header line

I have a problem with ActionBar in my application; In some scenarios, the ActionBar seems to fall under the notification / title bar. It is played every time, and I can’t understand why this is happening. I use the ZXING application with Intents to scan barcodes and return them to my application, and at some point in this process a problem arises.

I thought it was best to show you a picture problem.

1: The initial screen of the application, everything is fine.

App home screen, no issues

2: Use the menu item to scan the barcode. It looks as expected.

Scan a product ...

3: The product page for the scanned item looks fine. If I click Cancel, however ...

Product page, all still normal. Press cancel ...

4: ActionBar has now come under the notification / title bar.

Home screen now shows the ActionBar under the notification / title bar

The only other mention of an error like this (that I can find) is contained in this GitHub issue for ActionBarSherlock (which I use): https://github.com/JakeWharton/ActionBarSherlock/issues/602

I checked and I am not doing anything strange with configChanges, as Jake mentions.

This problem is observed on my 4.2.2 device, unfortunately, I can not test a device prior to ICS.

Any thoughts or suggestions are welcome!

+4
source share
1 answer

I assume it will not get reset back when you go back from the zxing screen. In your activity for "Best", try restarting the window flags for full screen mode, for example:

@Override protected void onResume() { super.onResume(); //getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); setSystemUiVisibility(this, View.SYSTEM_UI_FLAG_VISIBLE /* SYSTEM_UI_FLAG_VISIBLE=0 */); } private static void setSystemUiVisibility(final Activity activity, final int newValue){ if (activity.getWindow() != null){ View v = activity.getWindow().getDecorView(); if (v != null) { try { Method methodSetSystemUIVisibility = v.getClass().getMethod("setSystemUiVisibility", int.class); methodSetSystemUIVisibility.invoke(v, newValue); } catch (Exception noop) { } } } } 
+2
source

Source: https://habr.com/ru/post/1487558/


All Articles