[solved]layout/view refreshs if keyboard slide in/out

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

[solved]layout/view refreshs if keyboard slide in/out

Postby scheich » Thu Nov 26, 2009 10:08 pm

Hi all!

First of all, this forum is very cool. I just started programming for android and I learned so much reading here....

At the moment I'm writing a simple game for android. But I have a small but terrible problem:

Have an Alert Dialog for text input, but if the screen orientation changes (from landscape to potrait/or other way) it resets the View(Layout?)-> The DialogBox closes unexpectly.

Other problem seems to be similar, If I slide out/in the keyboard on the G1 the actual layout seems to reset also.

Anybody know, what could be the problem?

greetz, scheich
Last edited by scheich on Fri Nov 27, 2009 1:08 pm, edited 1 time in total.
scheich
Junior Developer
Junior Developer
 
Posts: 16
Joined: Thu Nov 26, 2009 9:58 pm

Top

Re: layout/view refreshs if keyboard slide in/out

Postby jagtap.jj1 » Fri Nov 27, 2009 5:30 am

When screen orientation changes, the current activity gets restart, i.e. activity life cycle start from first. So u have to develop code considering configuration change(screen orientation) and activity life cycle.


scheich wrote:Hi all!

First of all, this forum is very cool. I just started programming for android and I learned so much reading here....

At the moment I'm writing a simple game for android. But I have a small but terrible problem:

Have an Alert Dialog for text input, but if the screen orientation changes (from landscape to potrait/or other way) it resets the View(Layout?)-> The DialogBox closes unexpectly.

Other problem seems to be similar, If I slide out/in the keyboard on the G1 the actual layout seems to reset also.

Anybody know, what could be the problem?

greetz, scheich
java-android developer
User avatar
jagtap.jj1
Senior Developer
Senior Developer
 
Posts: 124
Joined: Fri Aug 22, 2008 11:52 am
Location: India(Mumbai)

Postby scheich » Fri Nov 27, 2009 1:08 pm

Thank you! You bring me the right keyword. My problem was solved with the following in the manifest:



Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.         android:configChanges="keyboardHidden|orientation"
Parsed in 0.000 seconds, using GeSHi 1.0.8.4


for each activity.
scheich
Junior Developer
Junior Developer
 
Posts: 16
Joined: Thu Nov 26, 2009 9:58 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 9 guests