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. Android custom hardware

Hi all,

I need to create a custom phone hardware using android platform that
will use minimal functions..I don't need accelerometer, camera even
mic and loud speaker. all i need is a SIM card slot and minimal
hardware features that will accommodate a custom compiled android
platform. I need pointers on

a) where i can find help to create such a hardware. Even if it's in
PCB board with the right chipsets, that's good enough for prototyping.
b) are there any pointers on dos and don'ts on stripping down android
platform code to bare bones. minimalist version of android platform
needed, again i will not leverage apis pertaining to GPS,
Accelerometer, camera etc,

Any help will be much appreciated.



2. trying to write to file and failing

hi im just trying to save some text to a file on android and while it
works fine on the emulator "dont crash", when i try it on my phone it
crashes, what am i doing wrong? heres the code:

            File root = Environment.getExternalStorageDirectory();
            if (root.canWrite()){
                 File file = new File(root, "file.txt");
                 FileWriter writer = new FileWriter(file);
                 BufferedWriter out = new BufferedWriter(writer);
                 out.write("some data");
                 showMes("File saved.");
                 showMes("Could not save file.");
        }catch(Exception e){

i do know it crashes on " File root =
Environment.getExternalStorageDirectory(); " i just dont know why.
showMes() is just a function to make toast. thanks for any help.


3. My app crashes upon relaunch

4. Something wrong here, didn't expect to be resumed

5. Linkify-ed TextView non-linked text disappears on touch

6. No Phone Signal in Emulator (2.1)

7. catching both click and long click on a ListView