Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid KitKat Don't show taking camera picture on Nexus 4 (Android 4.4)
    primarykey
    data
    text
    <p>I have a problem when I called my code bellow from android devices, they show the Gallery and Camera, but when I run this code on Nexus 4 (android v4.4, KitKat), it didn't show the camera choosing. It shown only Gallery.</p> <p>Please help me for this issue</p> <p>Thanks, :)</p> <pre><code>private Uri outputFileUri = null; private String pathImage = null; private void chooseImage() { // Determine Uri of camera image to save. final File root = new File(Environment.getExternalStorageDirectory() + File.separator + getString(R.string.app_name) + File.separator); root.mkdirs(); final String fname = String.valueOf(System.currentTimeMillis()); final File sdImageMainDirectory = new File(root, fname); outputFileUri = Uri.fromFile(sdImageMainDirectory); // Camera. final List&lt;Intent&gt; cameraIntents = new ArrayList&lt;Intent&gt;(); final Intent captureIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); final PackageManager packageManager = getPackageManager(); final List&lt;ResolveInfo&gt; listCam = packageManager.queryIntentActivities(captureIntent, 0); for(ResolveInfo res : listCam) { final String packageName = res.activityInfo.packageName; final Intent intent = new Intent(captureIntent); intent.setComponent(new ComponentName(res.activityInfo.packageName, res.activityInfo.name)); intent.setPackage(packageName); intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri); cameraIntents.add(intent); } // Filesystem. final Intent galleryIntent = new Intent(Intent.ACTION_PICK); galleryIntent.setType("image/*"); // Chooser of filesystem options. final Intent chooserIntent = Intent.createChooser(galleryIntent, getString(R.string.title_pick_photo)); // Add the camera options. chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, cameraIntents.toArray(new Parcelable[]{})); startActivityForResult(chooserIntent, IActivity.PICK_GALLERY); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload