My application has many different screens, but only screens with EditText's on them have this bug.
The page loads at a normal speed but once the user clicks in an EditText, The enitre screen flashes white except for the ActionBar for a noticable amount of time (maybe a quarter to half a second) and then goes back to what it is supposed to look like (the background is gray not white). This only happens on the first EditText focus after the activity starts so once the screen flashes once, it won't do it again unless the activity is reloaded.
Here is the relevant part of the manifest:
<activity
android:name="com.bottegasol.com.android.migym.View.Views.FeedbackActivity"
android:label="#string/title_activity_feedback"
android:logo="#android:color/transparent"
android:screenOrientation="portrait"
android:theme="#style/Theme.Example"
android:uiOptions="splitActionBarWhenNarrow" >
</activity>
There is nothing in it related to the SoftKeyboard resizing or anything like that. And the code contains no focus or keyboard change listeners.
I got this bug on a Motorola Razor Maxx and an HTC One X both running Jellybean. My emulator running api 10 didn't get this problem. Does anyone have any idea of where to start hunting for this? I couldn't find anyone else with this issue.
Related
EDIT: When I used to click on searchView, my buttons would appear above the keyboard. Then I was told on stackOverflow to use the following code:
android:windowSoftInputMode=“adjustNothing"
or
android:windowSoftInputMode="adjustPan"
Placed the above code in AndroidManifest.xml under android:name=".MainActivity"
Now the buttons don't jump above the keyboard but they still do jump a little. It seems to me the jump is still affected by the rise of the 3 Android buttons at bottom of screen (home, back, 3rd button) that rise along with keyboard (At least that's how it works on my Samsung Galaxy Note 8).
Is there a code that goes in AndroidManifest.xml that also states that when the 3 android buttons (home, back, 3rd button) rise with keyboard, the buttons/labels and mapView won't rise along with it?
(Not using scrollView and using Constraint Layout.)
I have a problem, the keyboard is hidden very slow and has a delay to hide (approx 1 second).
I have another application, which uses fragments, normal work, the keyboard is hidden fast.
I have done some tests:
1 - when there is something behind the keyboard (cardview or another control like imageview), it freezes and lag for 1 second before hiding..
2 - when there is nothing behind (empty layout), hide quickly.
I leave two screenshots:
Normal Keyboard
Here, the keyboard is hidden, but look at the screen, is not refreshing !!!
After one second the screen is refreshed correctly and the keyboard is hidden, but why this happens?
thanks !!!
Add following line in AndroidManifest.xml
<activity
android:name=".YourActivity"
android:windowSoftInputMode="adjustPan"
android:label="#string/app_name"
>
If I position a text input in the lower half of a page, when the user taps it to show the virtual keyboard, the page automatically slides up. When you tap away from the keyboard, the page automatically slides down again. I.e., everything is fine.
But when the text input is located in the top half of the page (in which case the page doesn't automatically slide when the keyboard appears), the behaviour is bad:
User taps the text input;
The whole screen (except the text input) turns black momentarily, then the keyboard slides up;
The user taps away from the keyboard;
The screen flashes black before the page is rendered again.
However, if you try the above steps a second time, the sequence is:
1. Same as above;
Same as above;
Same as above;
The screen turns black and stays black;
The user taps on the black screen;
The page is shown again.
I've tried a few different things, like detecting when the text input loses focus (i.e., keyboard hidden) to show to page, scroll the page, etc. but nothing seems to prevent this problem with the black screen.
Showing a javascript alert when the text input loses focus avoids the black screen problem (but I don't want an alert to show either!).
I've also tried using android:hardwareAccelerated="true" inside my AndroidManifest.xml's tag. And whilst that does fix this particular problem, it unfortunately creates many more rendering problems throughout the web app.
Does anyone have any suggestions?
Put this code in your manifest file in your launching activity tag
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:windowSoftInputMode="stateHidden|adjustPan"
I'm using an android search dialog in my app, and it works fine in Portrait orientation. But as soon as you flip to landscape orientation the searchpage xml appears to be covered by a large white dialog box. If you do a search, the box is still there, and you hit the back button on the device or emulator, the large white box slides away and there are your search results. It seems like somehere in the code a layout width is set to fill_parent or something. I've looked around for a solution and someone suggested adding android:imeOptions="flagNoExtractUi" to seachable.xml in the xml folder, but that doesn't seem to have any effect.
I've discovered that it's the onSearchRequested(); method that is throwing up that white box that fills the screen. And it also may have something to do with the fact that the software keyboard isn't called when in landscape, vertical orientation.
You could create your own Dialog in the form of an Activity. You do that like this:
<activity
android:theme="#android:style/Theme.Dialog"
android:configChanges="keyboardHidden|orientation|screenSize"
android:name="ExampleActivity" >
</activity>
This Activity can of course be arranged any way you like via the XML. This way, you can gracefully handle the change from portrait to landscape.
Note: You only need the "screenSize" attribute if you are using ICS (14+).
I'm working on an app and have a small problem when the soft keyboard is shown before switching activities. This happens when:
The user hits the search button
They enter a search term, view the search in a new activity and then return to the previous page
When the user returns to the previous page, a black box flashes where the soft keyboard was and then returns to normal
If the list is turned off or empty this problem never manifests. I have tried to enable caching of the listview children, hiding the listview when the activity pauses but to no avail. I would really appreciate any insight into why this might be occuring.
Thanks,
Laurence
Thought I'd follow up.
This problem was specific to pre Android 3.0 devices. On HC, ICS and JB this is no longer exhibited. As simple way to get around this on older versions of Android is to just change the windows background to match the color of your view. It still is blanked out but no where near as noticeable as black on white.