So, I'm trying to make an activity that's basically a video splash
screen:
package com.coolfone.videosplash;
import com.example.android.apis.R;
import android.app.Activity;
import android.net.Uri;
import android.os.Bundle;
import android.widget.MediaController;
import android.widget.Toast;
import android.widget.VideoView;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
public class Video_Splash_Activity extends Activity {
private VideoView mVideoView;
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.videoview);
mVideoView = (VideoView) findViewById(R.id.surface_view);
mVideoView.setVideoURI(Uri.parse("android.resource://"
+getPackageName() + "/"+R.raw.coolfone2));
mVideoView.setMediaController(new MediaController(this));
mVideoView.requestFocus();
mVideoView.setOnCompletionListener(new OnCompletionListener(){
@Override
public void onCompletion(MediaPlayer mp) {
finish();
}
});
mVideoView.start();
}
}
However, I get this error on completion:
11-28 12:22:20.920: E/ActivityThread(780): Activity
com.example.android.apis.media.VideoViewDemo has leaked IntentReceiver
android.widget.VideoView$UsrActivityReceiver@40576460 that was
originally registered here. Are you missing a call to
unregisterReceiver()?
11-28 12:22:20.920: E/ActivityThread(780):
android.app.IntentReceiverLeaked: Activity
com.example.android.apis.media.VideoViewDemo has leaked IntentReceiver
android.widget.VideoView$UsrActivityReceiver@40576460 that was
originally registered here. Are you missing a call to
unregisterReceiver()?
11-28 12:22:20.920: E/ActivityThread(780): at android.app.LoadedApk
$ReceiverDispatcher.<init>(LoadedApk.java:756)
11-28 12:22:20.920: E/ActivityThread(780): at
android.app.LoadedApk.getReceiverDispatcher(LoadedApk.java:551)
11-28 12:22:20.920: E/ActivityThread(780): at
android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:792)
11-28 12:22:20.920: E/ActivityThread(780): at
android.app.ContextImpl.registerReceiver(ContextImpl.java:779)
11-28 12:22:20.920: E/ActivityThread(780): at
android.app.ContextImpl.registerReceiver(ContextImpl.java:773)
11-28 12:22:20.920: E/ActivityThread(780): at
android.content.ContextWrapper.registerReceiver(ContextWrapper.java:
318)
11-28 12:22:20.920: E/ActivityThread(780): at
android.widget.VideoView.initVideoView(VideoView.java:210)
11-28 12:22:20.920: E/ActivityThread(780): at
android.widget.VideoView.<init>(VideoView.java:135)
11-28 12:22:20.920: E/ActivityThread(780): at
android.widget.VideoView.<init>(VideoView.java:129)
11-28 12:22:20.920: E/ActivityThread(780): at
java.lang.reflect.Constructor.constructNative(Native Method)
11-28 12:22:20.920: E/ActivityThread(780): at
java.lang.reflect.Constructor.newInstance(Constructor.java:415)
11-28 12:22:20.920: E/ActivityThread(780): at
android.view.LayoutInflater.createView(LayoutInflater.java:505)
11-28 12:22:20.920: E/ActivityThread(780): at
com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:
56)
11-28 12:22:20.920: E/ActivityThread(780): at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
11-28 12:22:20.920: E/ActivityThread(780): at
android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
11-28 12:22:20.920: E/ActivityThread(780): at
android.view.LayoutInflater.inflate(LayoutInflater.java:408)
11-28 12:22:20.920: E/ActivityThread(780): at
android.view.LayoutInflater.inflate(LayoutInflater.java:320)
11-28 12:22:20.920: E/ActivityThread(780): at
android.view.LayoutInflater.inflate(LayoutInflater.java:276)
11-28 12:22:20.920: E/ActivityThread(780): at
com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:
207)
11-28 12:22:20.920: E/ActivityThread(780): at
android.app.Activity.setContentView(Activity.java:1676)
11-28 12:22:20.920: E/ActivityThread(780): at
com.example.android.apis.media.VideoViewDemo.onCreate(VideoViewDemo.java:
43)
11-28 12:22:20.920: E/ActivityThread(780): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1047)
11-28 12:22:20.920: E/ActivityThread(780): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
1586)
11-28 12:22:20.920: E/ActivityThread(780): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
1638)
11-28 12:22:20.920: E/ActivityThread(780): at
android.app.ActivityThread.access$1500(ActivityThread.java:117)
11-28 12:22:20.920: E/ActivityThread(780): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:928)
11-28 12:22:20.920: E/ActivityThread(780): at
android.os.Handler.dispatchMessage(Handler.java:99)
11-28 12:22:20.920: E/ActivityThread(780): at
android.os.Looper.loop(Looper.java:123)
11-28 12:22:20.920: E/ActivityThread(780): at
android.app.ActivityThread.main(ActivityThread.java:3647)
11-28 12:22:20.920: E/ActivityThread(780): at
java.lang.reflect.Method.invokeNative(Native Method)
11-28 12:22:20.920: E/ActivityThread(780): at
java.lang.reflect.Method.invoke(Method.java:507)
11-28 12:22:20.920: E/ActivityThread(780): at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:839)
11-28 12:22:20.920: E/ActivityThread(780): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
11-28 12:22:20.920: E/ActivityThread(780): at
dalvik.system.NativeStart.main(Native Method)
Any ideas?
--
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