android


SoftKeyboardStateListener not working on Lollipop devices


This is the way I use to listen for soft keyboard visibility changing:
final SoftKeyboardStateWatcher softKeyboardStateWatcher
= new SoftKeyboardStateWatcher(mainLayout);
softKeyboardStateWatcher.addSoftKeyboardStateListener(new SoftKeyboardStateWatcher.SoftKeyboardStateListener() {
#Override
public void onSoftKeyboardOpened(int keyboardHeightInPx) {
bottomToolbar.setVisibility(View.GONE);
}
#Override
public void onSoftKeyboardClosed() {
bottomToolbar.setVisibility(View.VISIBLE);
}
});
My app is made for SDK >= 16 and works perfect for all pre-Lollipop devices and I tested it on HTC One M7 with 5.0.2 Android and results were ok. But, when I tried to test it with Nexus 4, API 22 and Nexus 5, API 23, onSoftKeyboardOpened and onSoftKeyboardClosed are never get called.
How can I solve this problem?
Thanks!
Try this,
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);
I hope this may help you.. :)

Related Links

Android - trying to send POST request, throws an exception with no message
Android attr to xml drawables
Reboot receiver is not working in xiaomi phones
Broadcast Receiver on Pending intent is not working
OnClickListener on the Listview Filter
Why would getSettings return null on a webview?
How do I redraw multiple child views at the same time?
How to set a selected item from the get adapter value in an Android spinner?
Hide Mobile Number while calling
Why are Branch links are not deep linking from Facebook app on Android?
resize Drawer width based on text content in android
Achieving accurate timing in android
Create Layout/Screen with four ImageButtons (all of the same size)
Get value part from spinner not text part in android
display counter notification in icon launcher android
Executing a Process in Android to read a file

Categories

HOME
sonarqube
adal
paraview
string
nunit
themes
jwplayer
pdfbox
google-cloud-functions
telegram-bot
google-admin-sdk
angularfire2
retrofit2
webix
accessibility
distribution
mxgraph
eip
3nf
heat
mongodb-csharp
feathersjs
asp.net-mvc-viewmodel
apache2.4
jquery-ias
ios10.2
qliksense
beta
tiki-wiki
stackexchange
asymptotic-complexity
8051
intersystems-cache
livelink
paragraph
jett
android-maps-extensions
getpixel
carriage-return
html-encode
python-import
arduino-ide
sharepoint-workflow
cd
apns-php
setup.py
attributeerror
escpos
parser-generator
plr
ovf
cnc
trojan
corruption
janus
universal-analytics
jtree
javafx-css
donations
atlas
pacemaker
google-cloud-console
myspace
dotnetnuke-7
jodd
x-tag
delta
udpclient
clipboard.js
php-socket
assertion
django-urls
atoi
viola-jones
haskell-warp
airbrake
omnifaces
git-ftp
android-broadcast
user-permissions
cross-join
android-vibration
easyrtc
multitasking
dtmf
tlf
time.h
xcode3.2
veracity
paginator
cuda-gdb
fusefabric
wiimote
flex-mobile
ikimagebrowserview
dot-emacs
openfaces
pos-for-.net
cuda.net
wcf-proxy
great-circle

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile