android - Opening Default Camera using Intent , overriding other apps? -
i trying open camera app, there other apps installed, such candy
, retrica
, phone asks 1 open. however, want open default camera, default in every devices. solution? here code:
public void camerafuture(view view) { intent intent = new intent(android.provider.mediastore.action_image_capture); startactivityforresult(intent, 0); } protected void onactivityresult(int requestcode, int resultcode, intent data) { // todo auto-generated method stub super.onactivityresult(requestcode, resultcode, data); imageview iv = (imageview)findviewbyid(r.id.camtemp); bitmap bp = (bitmap) data.getextras().get("data"); iv.setimagebitmap(bp); }
- first of package name of camera want open default .(if need let know how this)
just write code. change package name got camera - setpackage("place new package name in here") method
intent mintent = null; mintent = new intent(); mintent.setpackage("com.sec.android.app.camera");
mintent.setaction(android.provider.mediastore.action_image_capture); enter code herestartactivity(mintent);
Comments
Post a Comment