Snippet of kivy code:
from jnius import autoclass
from jnius import cast
from android import activity
Activity = autoclass('android.app.Activity')
PythonActivity = autoclass(".kivy.android.PythonActivity")
Intent = autoclass('android.content.Intent')
Uri = autoclass('android.Uri')
File = autoclass('java.io.File')
Env = autoclass('android.os.Environment')
FileProvider = autoclass('androidx.core.content.FileProvider')
activity = cast('android.app.Activity', PythonActivity.mActivity)
context = cast('android.content.ContextWrapper', activity.getApplicationContext())
#activity.bind(on_activity_result = on_activity_result)
intent = Intent(Intent.ACTION_OPEN_DOCUMENT)
intent.addCategory(Intent.CATEGORY_OPENABLE)
intent.setType("*/*")
dir = '/storage/emulated/0/Download/'
file = File(dir, "DJI_20250323065908_0008_D.SRT")
fileUri=FileProvider.getUriForFile(activity.getApplicationContext(), ".levy.srt2j.fileprovider", file)
And section of manifest as created by buildozer [1.5.0] (quotes introduced by buildozer):
"<application>
<provider
android:name="androidx.core.content.FileProvider"
android:authorities=".levy.srt2j.fileprovider"
android:grantUriPermissions="true"
android:exported="false">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/filepaths" />
</provider>
"
I have checked the actual Manifest by using AndroidStudio to analyze the apk file and it matches the above (with the quotes removed).
It appears that the authority is identical between the two files. Why, when running the app on the target (Samsung Tablet running Android 10 API 29) do I receive the error thru logcat.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1743742166a4499344.html
评论列表(0条)