MovieViewControl unable to become a receiver during Broadcast
Posted
by Paulina D
on Stack Overflow
See other posts from Stack Overflow
or by Paulina D
Published on 2010-05-26T16:48:50Z
Indexed on
2010/05/26
16:51 UTC
Read the original article
Hit count: 330
gallery
|broadcastreceiver
Hi!
I'm currently trying to catch a broadcast message with the MovieViewControl class, already added the filter in the Manifest
//In MovieViewControl private static final String SERVICECMD = "com.android.music.musicservicecommand"; private static final String CMDNAME = "command"; private static final String CMDPAUSE = "pause";
@Override
public void onReceive(Context context, Intent intent) {
String intentAction = intent.getAction();
if (AudioManager.ACTION_AUDIO_BECOMING_NOISY.equals(intentAction)) {
Intent i = new Intent(intent.ACTION_MAIN);
i.setAction(SERVICECMD);
i.putExtra(CMDNAME, CMDPAUSE);
mVideoView.pause();
context.startActivity(i);
}
}
but when I do my trial, I get this (very) huge exception:
W/dalvikvm( 1630): threadid=3: thread exiting with uncaught exception (group=0x4001b1b8)
E/AndroidRuntime( 1630): Uncaught handler: thread main exiting due to uncaught exception
E/AndroidRuntime( 1630): java.lang.RuntimeException: Unable to instantiate receiver com.android.gallery.MovieViewControl: java.lang.ClassNotFoundException: com.android.gallery.MovieViewControl in loader dalvik.system.PathClassLoader@438ff048
E/AndroidRuntime( 1630): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2616)
E/AndroidRuntime( 1630): at android.app.ActivityThread.access$3100(ActivityThread.java:119)
E/AndroidRuntime( 1630): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1913)
E/AndroidRuntime( 1630): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 1630): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 1630): at android.app.ActivityThread.main(ActivityThread.java:4363)
E/AndroidRuntime( 1630): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 1630): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 1630): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
E/AndroidRuntime( 1630): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
E/AndroidRuntime( 1630): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 1630): Caused by: java.lang.ClassNotFoundException: com.android.gallery.MovieViewControl in loader dalvik.system.PathClassLoader@438ff048
E/AndroidRuntime( 1630): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
E/AndroidRuntime( 1630): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
E/AndroidRuntime( 1630): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
E/AndroidRuntime( 1630): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2609)
E/AndroidRuntime( 1630): ... 10 more
Any hints on what might I be missing?
Thanks in advance!
© Stack Overflow or respective owner