Hi, dear
I want to build a live video chating system.
In my design, there are two activities:
1. chat
People can chat in this activity.
There should be a list of TextView, dynamic changing when someone is
talking.
2. Live video player
In this activity, a WebView embed a flash player to play the live
stream.
I can overwrite the onOptionsItemSelected in Activities to switch between
Activities
Here is a part of my code:
public boolean onOptionsItemSelected(MenuItem item){
switch(item.getItemId()){
case Menu.FIRST;:
Intent intent = new Intent();
intent.setClass(Video.this,Chat.class);
startActivity(intent);
break;
default:
}
return super.onOptionsItemSelected(item);
}
and, here is my problem:
When I am chating with other people, the live stream should still alive.
However, when I change the activity from Live video player to chat
Activities
Intent intent = new Intent();
intent.setClass(Video.this,Chat.class);
startActivity(intent);
would recreate the Chat activity, and the original activity(Live video
player) would be paused.
So, is there any solution to make the flash player play like in background?
even when changing activities, this flash player is still playing.
P.S I have tried to put a webview with a flash player embed in in Service
and get the
webview back from Service and add it to chat activity.
then I get an error:
Thread [<1> main] (Suspended (exception ClassCastException))
ViewRoot.draw(boolean) line: 1634
ViewRoot.performTraversals() line: 1323
ViewRoot.handleMessage(Message) line: 1959
ViewRoot(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 150
ActivityThread.main(String[]) line: 4310
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean)
line: not available [native method]
Method.invoke(Object, Object...) line: 507
ZygoteInit$MethodAndArgsCaller.run() line: 839
ZygoteInit.main(String[]) line: 597
NativeStart.main(String[]) line: not available [native method]
But, when the webview just load a normal url without flash like
www.google.com,
it will load successfully.
--
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