TestersGonnaTest
TestersGonnaTest

Reputation: 1027

How to get the value for SoftInputMode

I am having some issues with a Phonegap app for Android with the soft keyboard.

Other solutions are welcomed.

Here is my current code:

@Override
public void onPageFinished(WebView view, String url) {
   //Implement your code
   if(url.lastIndexOf("/pagewithform") != -1) {
      getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
   } else {
      getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
   }
   super.onPageFinished(view, url);
}

Upvotes: 5

Views: 2576

Answers (2)

MSiddeek
MSiddeek

Reputation: 71

Try this:

getActivity().getWindow().getAttributes().softInputMode

Upvotes: 0

Y2i
Y2i

Reputation: 3868

Would this work?

getWindow().getAttributes().softInputMode

Upvotes: 14

Related Questions