Comments (3)
hi, I found the solution.
In the manifest file, I updated like below, it worked very well in Android 11.
-
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
-
tools:ignore="ScopedStorage"/>
-
<queries>
-
<intent>
-
<action android:name="android.media.action.IMAGE_CAPTURE" />
-
</intent>
-
<intent>
-
<action android:name="android.media.action.VIDEO_CAPTURE" />
-
</intent>
-
</queries>
Let's try it.
from android-filepicker.
hi, I had the solution for Android 11
I updated the lib at the function dispatchTakePictureIntent like this
fun dispatchTakePictureIntent(): Intent? {
val takePictureIntent = Intent(MediaStore.ACTION_IMAGE_CAPTURE)
// Ensure that there's a camera activity to handle the intent
if (Build.VERSION.SDK_INT >=29) {
filephoto = getImageFile(File(mContext.getFilesDir(), "filepicker"))
val authority =
mContext.packageName + mContext.getString(R.string.image_picker_provider_authority_suffix)
photoURI = FileProvider.getUriForFile(mContext, authority, filephoto!!)
takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI)
return takePictureIntent
} else {
if (takePictureIntent.resolveActivity(mContext.packageManager) != null) {
// Create the File where the photo should go
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
filephoto = getImageFile(File(mContext.getFilesDir(), "filepicker"))
val authority =
mContext.packageName + mContext.getString(R.string.image_picker_provider_authority_suffix)
photoURI = FileProvider.getUriForFile(mContext, authority, filephoto!!)
takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI)
} else {
filephoto = getImageFile(File(mContext.getExternalCacheDir(), "filepicker"))
takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(filephoto))
}
return takePictureIntent
}
}
return null
}
It worked well in Android 11
If you want the demo, let contact me via skype: vantuan2009
from android-filepicker.
un dispatchTakePictureIntent(): Intent? { val takePictureIntent = Intent(MediaStore.ACTION_IMAGE_CAPTURE) // Ensure that there's a camera activity to handle the intent if (Build.VERSION.SDK_INT >=29) { filephoto = getImageFile(File(mContext.getFilesDir(), "filepicker")) val authority = mContext.packageName + mContext.getString(R.string.image_picker_provider_authority_suffix) photoURI = FileProvider.getUriForFile(mContext, authority, filephoto!!) takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI) return takePictureIntent
} else { if (takePictureIntent.resolveActivity(mContext.packageManager) != null) { // Create the File where the photo should go if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { filephoto = getImageFile(File(mContext.getFilesDir(), "filepicker")) val authority = mContext.packageName + mContext.getString(R.string.image_picker_provider_authority_suffix) photoURI = FileProvider.getUriForFile(mContext, authority, filephoto!!) takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI) } else { filephoto = getImageFile(File(mContext.getExternalCacheDir(), "filepicker")) takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(filephoto)) } return takePictureIntent } } return null }
Hi can you share ImageCaptureManager file
from android-filepicker.
Related Issues (20)
- Files with same file name not showing.
- Related To addFileSupport() When I try To Customize file support with CAD Or Revit Files Not Loaded
- How to get file real name with extension
- Doc list page cannot find document file data HOT 3
- Android 10 showing placeholder images even though requestLegacyExternalStorage = "true" ? HOT 3
- translation - Hebrew support + RTL HOT 1
- pick image and document's file at the same screen
- Caused by java.lang.NoSuchMethodException
- Document list is not showing in android version 11 HOT 5
- Getting Glide issue Unable to find GlideModule implementation and Caused by: java.lang.ClassNotFoundException: Didn't find class "com.thehackshield.Chat.status.glideProgressBar.OkHttpProgressGlideModule"
- Clicking "Done" after multiple selection not closes the gallery, but it navigates back one step. HOT 1
- android 11 java.lang.NumberFormatException HOT 1
- Document list is not showing in android version 8 HOT 3
- App crash after picking image from gallery in android 11 and above HOT 1
- File pick
- Project is discontinued or still in maintenance ? HOT 2
- Crash RuntimeException: android.os.TransactionTooLargeException: data parcel size 550896 bytes HOT 2
- problem compatibility android 13 HOT 4
- DroidNinja/Android-FilePicker HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-filepicker.