handling keyboard open and close (not restarting)

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

handling keyboard open and close (not restarting)

Postby isaackearl » Fri Jan 09, 2009 8:16 pm

Can anybody give me a code example of how to keep my app from restarting everytime the keyboard is open and closed? I've searched the novice tutorials and can't find anything. It would really help me out, thanks!

Isaac
isaackearl
Junior Developer
Junior Developer
 
Posts: 20
Joined: Tue Nov 25, 2008 8:09 pm

Top

Postby Quetzalcoatl » Sat Jan 10, 2009 1:08 am

Try adding this to your android manifest:

<activity android:name=".Project"
android:configChanges="keyboardHidden|orientation"
android:label="@string/app_name">

It stopped it from restarting when I pressed CTRL+F12 to switch from portrait to landscape but have not tested on target yet
Image
Quetzalcoatl
Senior Developer
Senior Developer
 
Posts: 129
Joined: Sat Oct 18, 2008 8:21 pm
Location: near Manchester, UK

Postby Emmanuel7 » Sat Jan 10, 2009 4:05 am

THe simpler is to modify the screenorientation parameterfor your activity in your manifest.

See the documentation :
here
You can impose there the orientation, decide to let the system decide ( based on the keyboard status on the G1 ), or let the real device orientation decide.

A good tutorial on orientation is here :
here
Emmanuel7
Senior Developer
Senior Developer
 
Posts: 164
Joined: Fri Dec 12, 2008 2:17 am
Location: Paris

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 9 guests