How to open an Android device's default camera without showing the chooser. -


i have button that, when pressed, user gets asked choose camera app , allows him/her take picture.

firstly, want rid of choice when button pressed user in camera interface. code i'm using right (after having tried many solutions online), prompt user choose camera:

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

i have skimmed through few articles not possible launch android native/default camera without chooser - however, see apps facebook , whatsapp able i'm sure possible.

as appreciate help. in advance!

there 2 ways access camera in android- can send intent existing app, doing here, or can build custom camera feature within app. easier use existing apps, have seen, user must choose app. facebook , whatsapp using custom camera feature. http://developer.android.com/guide/topics/media/camera.html#custom-camera


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -