Question

I'm attempting to react to a size change in my app. Or more specifically I'm trying to figure out when the keyboard shows up.

I've tried @Override ... onSizeChanged() of the main windows (a RelativeLayout view extension) It gets called when I change the orientation, but not when I show/hide the keyboard.
My layout is not scrolling, so the controls at the top of my screen fall out of view, and the only way to get them back is to hide the keyboard.

I've read a pile of other sites and googled the snot out of this one, but it has me befuddled.

Oh.. I'm on a 2.1 (aka 7) build of android, and I'd like to be able to run the app on my own phone :)

Oh.. so the question. How do I catch something resembling onSize on an android device.

Was it helpful?

Solution

Try to add below to related activity in manifest.xml

android:windowSoftInputMode="adjustPan" 

For Example

<activity android:name=".SignUp"
   android:screenOrientation="portrait"
   android:windowSoftInputMode="adjustPan" >
   <intent-filter>
        <action android:name="android.intent.action.ACTIVITY" />
   </intent-filter>
</activity>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top