Hello All

One thing more I like to ask you...
I have an application running in background...and a second application
which is a video player running on foreground build on flash
technology...
My work is to launch this application via my background application
and give it the content to play after downloading from the remote
server and I did it successfully...
but My problem is that...
the key event code is written in foreground app(ie in player) ,when we
press 'L' using keyboard then it display live...
and when we press 'R' then it resume to play its recorded or
downloaded contents....
but when I want to send the same key through my background app on
it...it not work...and cause an fatal error and my background program
crashed...
I did it using the Instrumentation class
like

Instrumentation inst = new Instrumentation();
 inst.sendKeyDownUpSync(KeyEvent.KEYCODE_L);

but it not work
I also did it using Intent and keyevent class but the result remain
abortive


KeyEvent lKey1Dwn = new
KeyEvent(KeyEvent.ACTION_DOWN,KeyEvent.KEYCODE_L);
KeyEvent lKey1Up = new
KeyEvent(KeyEvent.ACTION_UP,KeyEvent.KEYCODE_L);
Intent lKey1DwnIntent = new Intent(Intent.ACTION_MEDIA_BUTTON);
Intent lKey1UpIntent = new Intent(Intent.ACTION_MEDIA_BUTTON);
lKey1UpIntent.putExtra(Intent.EXTRA_KEY_EVENT, lKey1Up);
lKey1DwnIntent.putExtra(Intent.EXTRA_KEY_EVENT, lKey1Dwn );
ctx.sendBroadcast(lKey1DwnIntent);
ctx.sendBroadcast(lKey1UpIntent);

(where ctx is an instance of Context on that page.)

can u plz help me?
I will be thankful to you.

-- 
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

Reply via email to