I am writing a small streaming application with purpose to test send
Activity to background and send Activity to foreground functionality.
Basically it looks like illustrated below. From the logs you can see
that the platform is trying to bring the streaming application to
front again, but unfortunately it fails to do so. Can someone give me
a hint what I am doing wrong ? I know my example is not best practice.
You should use notifications instead, but I still need to know why
this does not work as expected.
I tried this but unfortunately this did not work. Am I doing something
wrong ?
I enclose my piece of code and some log prints.
Intent myIntent = myStreamingPlayer.getIntent();
// Start StreamingPlayer etc ...
....
....
// Move StremingPlayer to background
myStreamingPlayer.moveTaskToBack(true);
// Play 5 more seconds
SystemClock.sleep(5000);
// move StreamingPlayer to foreground
myStreamingPlayer.startActivity(myIntent);
Unfortunately the StreamingPlayer remains in background here ...
02-23 10:21:49.897: DEBUG/StreamingPlayer(4707): Prepare called
02-23 10:21:51.897: DEBUG/StreamingPlayer(4707): onBufferingUpdate
called ---> percent:0
02-23 10:21:55.567: DEBUG/StreamingPlayer(4707): onBufferingUpdate
called ---> percent:100
02-23 10:21:55.657: DEBUG/StreamingPlayer(4707): Start called
02-23 10:21:55.657: DEBUG/StreamingPlayer(4707): onPrepared called
02-23 10:21:55.927: WARN/AudioFlinger(35): write blocked for 133 msecs
02-23 10:22:00.707: INFO/ActivityManager(60): moveTaskToBack: 28
02-23 10:22:01.187: DEBUG/StreamingPlayer(4707): surfaceDestroyed
called
02-23 10:22:01.257: WARN/InputManagerService(60): Starting input on
non-focused client com.android.internal.view.IInputMethodClient$Stub
$pr...@436d7b48 (uid=10034 pid=4707)
02-23 10:22:05.727: INFO/ActivityManager(60): Starting activity:
Intent { action=android.intent.action.MAIN flags=0x10000000
comp={com.streamingplayer/com.streamingplayer.StreamingPlayer} }
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en