Question

I know this question was asked before, but the answer didn't work for me. So, i want to change somthing in my application when the softkeyboard pop-up. this is my code. i'm not trying to do anything interesting, just to see that onConfigurationChanged is called. what might be causing this, is that the activity that i'm setting the event for has a parent Tab activity. any how this is the code:

this is my Manifest file. MainTabActivity is the parent activity of MyActivity, MyActivity extends the abstract activity BaseActivity.

activity android:name=".MainTabActivity" android:configChanges="keyboardHidden"></activity>        
activity android:name=".BaseActivity" android:configChanges="keyboardHidden"></activity>                  
activity android:name=".MyActivity" android:theme="@style/Theme.NoBackground"
          android:configChanges="keyboardHidden"></activity>

this is m java code in MyActivity :

@Override
    public void onConfigurationChanged (Configuration newConfig) {
        showNewAlertBox("update", "key board is out");
        if(newConfig.hardKeyboardHidden == Configuration.KEYBOARDHIDDEN_NO){
            showNewAlertBox("update", "key board is out");
        } 
    }

as you can see i'm just trying to print something when the event is fired.

Était-ce utile?

La solution

The changes of visibility of the soft keyboard is not intercepted by onConfigChange because it is not a configuration change.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top