Ok, solved adding an explicit intent and filter directly in the
MovieView =)

On May 26, 12:13 pm, Paulina <winterdam...@gmail.com> wrote:
> Hi!
>
> I'm currently trying to catch a broadcast message with the
> MovieViewControl class, already added the filter in the Gallery's
> manifest:
>
> <receiver android:name="MovieViewControl">
>     <intent-filter>
>         <action android:name="android.media.AUDIO_BECOMING_NOISY"/>
>     </intent-filter>
> </receiver>
> ---------------------------------------------------------------------------
>
> //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.pathclassloa...@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.pathclassloa...@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!

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to