I'm new at android programming and I have a problem about starting new activity from my another class and media player. My activity class has a media controller. I try to call the activity like this:
public void Collide(FlxCore object1, FlxCore object2) {
player.kill();
Context mContext = null;
Intent myIntent = new Intent(mContext, soru.class);
mContext.startActivity(myIntent);
}
My activity is:
public class soru extends Activity {
private VideoView mVideoView;
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.soru);
mVideoView = (VideoView) findViewById(R.id.surface_view);
mVideoView.setVideoURI(Uri.parse("android.resource://"
+ getPackageName() + "/" + R.raw.arabaa));
mVideoView.setMediaController(new MediaController(this));
mVideoView.requestFocus();
}
}
Then the problem is
12-07 13:14:54.675: W/dalvikvm(526): threadid=9: thread exiting with uncaught exception (group=0x40015560)
12-07 13:14:54.675: E/AndroidRuntime(526): FATAL EXCEPTION: Thread-10
12-07 13:14:54.675: E/AndroidRuntime(526): java.lang.NullPointerException
12-07 13:14:54.675: E/AndroidRuntime(526): at android.content.ComponentName.<init>(ComponentName.java:75)
12-07 13:14:54.675: E/AndroidRuntime(526): at android.content.Intent.<init>(Intent.java:2702)
12-07 13:14:54.675: E/AndroidRuntime(526): at org.myname.flixeldemo.GameState$3.Collide(GameState.java:101)
12-07 13:14:54.675: E/AndroidRuntime(526): at org.flixel.FlxG.overlapArrayList(FlxG.java:456)
12-07 13:14:54.675: E/AndroidRuntime(526): at org.myname.flixeldemo.GameState.update(GameState.java:95)
12-07 13:14:54.675: E/AndroidRuntime(526): at org.flixel.FlxGame.onEnterFrame(FlxGame.java:327)
12-07 13:14:54.675: E/AndroidRuntime(526): at org.flixel.FlxGameView$GameThread.run(FlxGameView.java:55)
12-07 13:14:54.815: E/MediaPlayer(526): pause called in state 64
12-07 13:14:54.815: E/MediaPlayer(526): error (-38, 0)
12-07 13:14:54.815: E/MediaPlayer(526): Error (-38,0)
12-07 13:19:54.830: I/Process(526): Sending signal. PID: 526 SIG: 9
I couldn't understand the what the problem really is and how can I fix it.Please help me.