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

Error loading preferences ANDROID emulator on intelj last version
ActionBar Sherlock - Backgroundimage in Actionbar
Android IP fetching
Black screen when loading web image to Android
AdView missing requied xml attribute adSize in android using google adds
Android USB Host - bulkTransfer() is losing data
Videos not playing in fullscreen mode
Android Resource for Survey App design
Any reports of bizarre Android force close errors?
Let parent View assume MotionEvents if child returns false
Android - BroadcastReceiver trying to return result during a non-ordered broadcast
Non destroyable full screen mobclix ads
Why does my title image disappear?
How to display the previous map zoom level after finishing the current map in android
How can I make findViewById get the id attibute on the XML dynamically (Android)?
Android - Mulitple listeners on a single view with the ability to pass off events to other views

Categories

HOME
uml
algorithm
google-app-engine
fabricjs
microsoftgraph
api
dns
pyqt
battery
jelastic
jwplayer
r-googlesheets
mapbox
missing-data
joomla3.0
discrete-mathematics
qpython
distribution
xcodebuild
ipmitool
pybossa
aws-sdk
fileserver
google-picker
windows-xp
symbols
asciidoctor-pdf
ag
cgbitmapcontext
froala
itunes
entity-relationship-model
handler
errbot
failover
zend-debugger
memory-address
code-snippets
github3.py
carriage-return
playframework-2.1
xcode7.3
projects-and-solutions
comparison-operators
datacachefactory
postgresql-8.4
subclipse
print-css
snapchat
nanoc
ntvs
chai-as-promised
amq
modelsim
janus
vibrate
pacemaker
envi
nikeplus-api
hclust
clipboard.js
createprocess
fuzzywuzzy
jparsec
ascii-art
tfs-workitem
avisynth
microsoft-reporting
poppler
evolus-pencil
pyobjc
rrule
code-documentation
qtwebengine
dbaccess
genymotion-call
encryption-asymmetric
build-script
extjs2
gwt-openlayers
isqlquery
kogrid
asdf
scmmanager
fragmenttransaction
uimanageddocument
objectquery
azman
usertype
jsr286
box2d-iphone
listactivity
quotation-marks
cac
office-2007
rowlex
eclipse-marketplace
folding
glui
xpsdocument
wysiwym
technical-debt
blind

Resources

Encrypt Message