Android Question How to use Intent for sent File to others app?

Theera

Well-Known Member
Licensed User
Longtime User
Hi all,
After I have learn Hamied's code for using Intent,I have studied addition from this . I can test some tutorials ,but in the part3 ,I can't learn it. It can't run.
I don't know what something be wrong differ to the example. I have attached my source code as below.
 

Attachments

  • TestIntentwithsharingFile.zip
    9.7 KB · Views: 71

teddybear

Well-Known Member
Licensed User
Hi all,
After I have learn Hamied's code for using Intent,I have studied addition from this . I can test some tutorials ,but in the part3 ,I can't learn it. It can't run.
I don't know what something be wrong differ to the example. I have attached my source code as below.
You should read the example carefully, Step 2 is the key to you.
Add the below to your manifest
B4X:
AddManifestText(<uses-permission
   android:name="android.permission.WRITE_EXTERNAL_STORAGE"
   android:maxSdkVersion="18" />
)

AddApplicationText(
  <provider
  android:name="android.support.v4.content.FileProvider"
  android:authorities="$PACKAGE$.provider"
  android:exported="false"
  android:grantUriPermissions="true">
  <meta-data
  android:name="android.support.FILE_PROVIDER_PATHS"
  android:resource="@xml/provider_paths"/>
  </provider>
)
 
Upvote 0

Hamied Abou Hulaikah

Well-Known Member
Licensed User
Longtime User
File provider configuration is not complete in your example.
You missed manifest code, add it & it will run smoothly:
add to manifest:
       AddManifestText(<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="18" />
)

AddApplicationText(
  <provider
android:name="android.support.v4.content.FileProvider"
android:authorities="$PACKAGE$.provider"
android:exported="false"
android:grantUriPermissions="true">
  <meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
  android:resource="@xml/provider_paths"/>
  </provider>
)
CreateResource(xml, provider_paths,
<files-path name="name" path="shared" />
)
 
Upvote 0
Top