protected VideoView mine;
protected boolean done = false;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.videoshow);
mine = (VideoView) findViewById(R.id.video); // Save the VideoView for touch event processing
try {
String myURI = "/sdcard/" + path + "/v/"
+ currentItem.getFile()
+ "." + currentItem.getFileType();
Uri video = Uri.parse(myURI);
mine.setVideoURI(video);
mine.start();
mine.setOnCompletionListener(new OnCompletionListener() {
public void onCompletion(MediaPlayer mp) {
result.putExtra("com.ejf.convincer01.Finished", true);
done = true;
}
});
} catch (Exception ex) {
Log.d(DEBUG_TAG, "Video failed: '" + ex + "'" );
}
从这段话看来PendingIntent应该类似于一个即将发生的intent,但是并没有产生~~可能有什么条件限制它在某个触发条件下会产生一个intent,而intent就是一个会被立即发送出的Intent,简单地说Intent会立即发送出去,而PendingIntent应该是在特定条件产生一个Intent的东东
错误提示:ERROR/AndroidRuntime(192): java.lang.RuntimeException: Unable to start receiver com.test.hmenu.HMenuReceiver: android.util.AndroidRuntimeException: Calling startActivity () from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
(总之出现这样的错误就要setflags(Intent.FLAG_ACTIVITY_NEW_TASK))
修改如下:
Intent it = new Intent(context,StartActivity.class); it.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);