Screen flip-out on G1

by Kirk » Wed, 29 Apr 2009 02:08:24 GMT

Sponsored Links
 What event in an Activity is called when the screen is flipped out to
expose the keyboard on a G1? I need to save some instance variables,
but it seems like onCreate is being called without onPause, onStop, or
saveInstanceState being called first.

Thanks in advance!

Screen flip-out on G1

by Yusuf T. Mobile » Wed, 29 Apr 2009 06:21:09 GMT

 Normally the activity is destroyed and recreated when Android detects
rotation, unless you specify that you want your activity to handle
events like turning the phone on its side or the keyboard opening.

It's documented here: 
You can read more about rotation here: 

Some tutorials you may come across may be obsolete on one point: there
used to be only the flag keyboardhidden, but Android recently added
hardKeyboardHidden, to handle the case of soft keyboards.

onSaveInstanceState() and onDestroy() should be called before your
activity is killed and revived, I'm not sure why you don't see it.

Yusuf Saib
T  Mobile stick together
The views, opinions and statements in this email are those of the
author solely in their individual capacity, and do not necessarily
represent those of T-Mobile USA, Inc.


Sponsored Links

Screen flip-out on G1

by Kirk » Thu, 30 Apr 2009 06:00:37 GMT

 Thanks Yusuf,

I'll take a look at those articles, hopefully they will help!



Other Threads

1. Why are onCreate() onStart() etc. called when handset orientation is changed?

Correct. By default, on an orientation change, Android destroys and
recreates your activity, to map in the appropriate layout resources and

Mark Murphy (a Commons Guy) |

_Android Programming Tutorials_ Version 1.0 Available!


2. Cursor Problem while handling

Hello all,

I have performed query and kept the data in cursor say mCur.
cursor mCur has 9 column with 22 rows in it.

a)   mNameCol[i] = cur.getString(cur.getColumnIndexOrThrow(CL_NAME));
b)   mAddCol[i]    = cur.getString(cur.getColumnIndexOrThrow(CL_ADD));


I can retrieve mNameCol i.e a) successfully, but mAddCol i.e b) stores
always null which is in the next line.
All the column can be retrieved replacing CL_NAME to the respective
column name while it is the first call in the cursor to retrieve, but
in the next line retrieval returns null.
which also means b) always returns null irrespective of the column
retireval and only a) always returns expected value respective to the
column in the cursor.

I suspect the problem with the pointer but restrain finding solution..

Any help would be helpful!!


3. Android Gmail Development Suggestions...

4. Socket - Network connect drops after 15 minutes

5. Accessing Contact Data Base for adding,deleting,updating contact using Native code

6. shape with shadow

7. Why are onCreate() onStart() etc. called when handset orientation is changed?