When the soft keyboard opens I want a scroll view to scroll down to the bottom.
For this I can use: fullScroll(View.FOCUS_DOWN);
But how do I fire that command after the soft keyboard opening event triggers?
When the soft keyboard opens I want a scroll view to scroll down to the bottom.
For this I can use: fullScroll(View.FOCUS_DOWN);
But how do I fire that command after the soft keyboard opening event triggers?
@BoD's answer works fine if I remove the following line.
for this what i used to do same:
and in your
Activity
orfragment
call this method inonCreate()
enjoy your code:)
watching the date , possibly you have a solution for your question, otherwise:
Here is the same response i made to another question related : Is there a way to tell if the soft-keyboard is shown?
but i copy full response here to avoid dead links:
Please check Configuration Changes for your Activity
This for your AndroidManifest.xml
and this for your Activity class http://developer.android.com/reference/android/app/Activity.html#onConfigurationChanged(android.content.res.Configuration)
You will need to @Override the public method onConfigurationChanged(android.content.res.Configuration) of your Activity to be able to handle, for example, this values:
hardKeyboardHidden,
keyboard,
keyboardHidden
For all possible values check http://developer.android.com/reference/android/content/res/Configuration.html
You will see there something like this:
Also there you will be able to read something like this:
UPDATE:
Here is a specific sample of what i´m talking about:
http://developer.android.com/guide/topics/resources/runtime-changes.html
I hope this help you
Here is my solution:
1/ A simple interface
2/ A utility method (put it where you want, for instance in a class named
KeyboardUtil
)3/ Use from an Activity this way (a good place is in onCreate):
Per this post and this post on android-developers it doesn't seem like it's possible to do what you want. You may want to re-examine your use case for what you're doing. Maybe one of the
softInputMode
flags will work for you.The only way I was able to work around this is by setting my activity's android:windowSoftInputMode="adjustResize" and then embed a custom "detector view" in the layout to handle a container size change and propagate that as a custom event (via a Listener) for soft keyboard on/off.
The following post describes an approach to implementing it: EditText does not trigger changes when back is pressed