android - Launch default camera app (no return) -


i'd launch default camera, want act started launcher (i.e. resulting picture should stored camera app user's gallery, rather being returned app). if use intent cameraintent = new intent(android.provider.mediastore.action_image_capture);, camera app uses "ok? retry?"-ui , doesn't save picture. i'd rather not use "direct" com.android.camera intent, because lot of devices use custom camera apps. i've seen stock gallery3d-app uses alias implementing com.android.camera/.camera, i'm not sure every pre-loaded manufacturer camera app this.

i've implemented this:

        intent = new intent(android.provider.mediastore.action_image_capture);         try {             packagemanager pm = mcontext.getpackagemanager();              final resolveinfo minfo = pm.resolveactivity(i, 0);              intent intent = new intent();             intent.setcomponent(new componentname(minfo.activityinfo.packagename, minfo.activityinfo.name));             intent.setaction(intent.action_main);             intent.addcategory(intent.category_launcher);              startactivity(intent);          } catch (exception e){ log.i(tag, "unable launch camera: " + e); } 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -