some issue about activity life cycle

by Philip Wang » Fri, 13 Nov 2009 09:59:13 GMT

Sponsored Links
 The main activity is running, then there is a interrupt. What was happended,
onPause(), onStop() or other change of life cycle?
1. pressed the volume_down key and ringer volume toast occured, the life of
main activity will not change? why?
2. short press the power key and the OS sleep,how about the activity ?
3. long press the power key and the phone options appear, how?
4. long press the home key and the tast list appear, how?
5. notifications curtain appear, how?
6. press the back key,how?


some issue about activity life cycle

by Philip » Fri, 13 Nov 2009 14:25:04 GMT

 It might be wordy. Thanks for any help. Here is other issue:
7. phone incoming, or clock ringing, how?
8. press menu key, how?
9. long press screen and a dialog pop-up, how ?
10. extra dialog pop-up, for example, another app crash and the dialog
of "force quit" occur, how?

Thanks again.


Sponsored Links

some issue about activity life cycle

by Philip » Sat, 14 Nov 2009 09:57:38 GMT

 Anyone can help me?


some issue about activity life cycle

by » Sat, 14 Nov 2009 13:01:14 GMT

 Hi Philip.

Your questions aren't worded very clearly, but if you'e asking which
Activity lifecycle events occur in the circumstances you list, why not just
test them all? Put log output lines in the lifecycle methods and see what
you get?

Makes of PhoneMyPC

2009/11/13 Philip <>


some issue about activity life cycle

by Philip » Wed, 25 Nov 2009 08:59:17 GMT

 Thank you, Scott.

On 114 10 ""

> >

Other Threads

1. Ringtones saved from audio files in SD card disappear after reboot

I'm having a problem creating ringtones from files saved to the SD
card.  I have succeeded in getting the information to be written to
the MediaStore database, and the files do show up in Settings -> Sound
& Display -> Phone ringtone.  However, as soon as I reboot the phone,
the files disappear from the list of ringtones.

The only clue I have is that the database in /data/data/<guid>.db is getting
its rows deleted on startup.  The files themselves are not changing.
Even stranger is that, if I simply copy the file from the SD card to
the files/ directory of the internal storage directory for my app, and
then save THAT file as the ringtone, it works!  However, it doesn't
really seem feasible to me to force the user to keep two copies of the
audio file.

I do have a .nomedia file in the audio files directory (to avoid the
files showing up in the Music app), but I have tested this with and
without the .nomedia file and the same problem occurs.

Below is my code for creating the ringtone/notification.  Any
suggestions for fixing this bug?  The users of my app would be really
grateful if I figured this out.  Thanks!!

MediaPlayer mediaPlayer = new MediaPlayer();
int duration = mediaPlayer.getDuration();

File file = new File(filename);

ContentValues values = new ContentValues();
values.put(MediaStore.MediaColumns.DATA, filename);
values.put(MediaStore.MediaColumns.SIZE, file.length());
values.put(MediaStore.MediaColumns.MIME_TYPE, "audio/ogg");
values.put(MediaStore.Audio.Media.ARTIST, "Artist Name");
values.put(MediaStore.Audio.Media.DURATION, duration);
values.put(MediaStore.Audio.Media.IS_RINGTONE, true);
values.put(MediaStore.Audio.Media.IS_NOTIFICATION, true);
values.put(MediaStore.Audio.Media.IS_ALARM, false);
values.put(MediaStore.Audio.Media.IS_MUSIC, false);

newUri = getContentResolver().insert(uri, values);


2. Export Signed Application Package... not working

I am using Windows XP and Eclipse to develop. I updated everything
today, the new sdk, the new adt etc. After that, when I tried to
"export signed application package", nothing happened. If I click
"export unsigned application package", a dialog box showed up.
Anything i missed? How can I fix this problem?


3. Mending Moto yang mana yah?

4. onActivityResult does not always get triggered when using IMAGE_CAPTURE with startActivityForResult

5. how to invalidate a single row in ListView with EfficientAdapter?

6. IMAGE_CAPTURE Intent and changing phone orientation

7. Automatic font size adjustment?