I am having an Activity with two RecyclerView with big amount of data.
Now I'm showing a Dialog on this Activity, Dialog is having multiple EditText and Spinner in it. so as soon as I start typing and keyboard appears at that time my UI is blocked. And same as when I hide keyboard at that time also my UI is blocked for couple of seconds. And ultimately I frequently get ANRs.
And yes If I comment out RecyclerViews from my Activity then same Dialog is working fine without any lag.
So how to overcome this problem can anyone help me in addressing this issue.
Related
I know this should not be a big challenge but it really drives me insane.
I am developing a simple soft keyboard input method and basically I have added a button to my softkeyboard, by pressing which, a dialog should pop up to prompt user to do some choices.
By far everything is ok about creating and opening the dialog. Since normally a dialog is created and displayed from outside an activity, so a flick solution could be to create a transparent activity which embedded the dialog in it. By doing so, I could easily start a dialog when user click the button on my softkeyboard.
But one tricky problem is: every time user click the button and the dialog (actually a dialog in a transparent activity) displays, it will always make my softkeyboard hide. I just need to start the dialog without any changes to the status of my softkeyboard -- I want my softkeyboard keeps showing when the dialog starts.
Here is a snapshot of Google Keyboard, it has the similar button which display a dialog and the dialog did not hide the keyboard, this is exactly what I want. So please anyone suggest me how to achieve this. Thanks so much.
THey aren't launching an Activity. They're launching a dialog. Which is tricky from an input method because its a service (you have to specify the dialog's window token to make it show) but doable.
I am having issue with Android Tablet.
I have created a runtime views as shown in Attachment(tab_before_error.png), when user clicks on Edittext then keyboard appears, after typing something I am making some operations in aftertextchanged callback. When I dismiss the Keyboard, there is Flickering as shown in attachment(tab_error.png).
What's the issue, why the system not able to render the UI immediately once the keyboard dismissal.
try to put the following line in ur activity tag in manifest..
android:windowSoftInputMode="stateHidden|adjustNothing"
I have implemented a note-taking UI where a WebView accepts user input and below it is a row of buttons that toggle formatting inside of the WebView. The buttons sit on the bottom of the layout, so when the soft-keyboard pops up when the WebView has focus the buttons sit just above the keyboard.
This is working great, but my problem is that whenever one of the buttons is pressed the soft-keyboard closes. I want to leave the soft-keyboard as it is whenever a button is pressed. So if it is closed, a button press won't open it, and if it is open then a button press won't close it.
I found the Wordpress Android source code, and the layout is extremely similar and it has the exact button-keyboard interaction I want.
The relevant sources on GitHub are here Activity Code and here Layout XML
I can't figure out how they do it though. They don't call the InputMethodManager, which I am trying to avoid if possible since it can cause jumpy behavior where the keyboard has to re-open itself whenever a button is pressed. The one similar question I found had answers that essentially said to do exactly that, or create a useless view to get the focus to prevent the keyboard from closing. Neither seem very efficient.
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.
I have an android app that uses a glSurfaceView that takes a few sections to load up.
I have onTouchEvent overridden, and I'm trying to disable focus while it loads but setFocusable(false) isn't working.
The problem is if the user taps on the screen before everything loads, the app gets a null and it crashes.
I'd pop up a progress dialog and use an AsyncTask to do the loading of the view. Once the view is loaded you can kill the dialog. Any heavy lifting should not be done on the UI thread anyway.