I'd like to launch a video capture Intent that calls me back with some kind of result. So far it correctly launches the G1's default Camcorder app, but when I finish recording the video in Camcorder, it just sits there (still in the Camcorder app) instead of calling my onActivityResult() method.
Is this just a shortcoming of Camcorder, or is there a special flag or extra I can set to tell it 开发者_如何学Pythonto return control when it's done recording? Ideally it would pass me back a handle to the video - a URI, an InputStream, a file path.
The code:
protected void launchRecordVideoActivity() {
Intent intent = new Intent (android.provider.MediaStore.ACTION_VIDEO_CAPTURE);
startActivityForResult (intent, RequestCodes.RECORD_VIDEO);
}
RequestCodes is my own interface containing int constants.
public void onActivityResult (int requestCode, int resultCode, Intent intent) {
...
}
The contents of onActivityResult don't matter because my app is never called back at all. onActivityResult is not being called.
Any suggestions? I can also bake the video recording directly into the app, but I'd prefer not to.
You can't (generally) call startActivityForResult on an intent that starts an application outside of your application
Same code works fine on SE x10 (updated to sdk 2.1). Activity starts, user starts recording video and when he press stop - video onActivityResult() is run in calling class. Probably it was fixed in later SDK releases.
精彩评论