I have an app which saves database files with extension ".swt" in a particular folder. I was able to share this file using intent from one device to other but the device which received the file could not open it through the same app.
Here is my AndroidManifest with intent-filter
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<data
android:scheme="file"
android:mimeType="*/*"
android:pathPattern=".*\\.swt"
android:host="*" />
</intent-filter>
Here is my code for sharing the files
ArrayList<Uri>uris = new ArrayList<>();
uris.add(Uri.fromFile(file1));
uris.add(Uri.fromFile(file2));
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND_MULTIPLE);
shareIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM,uris);
shareIntent.setType("*/*");
shareIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
startActivity(Intent.createChooser(shareIntent,"Share Files Using"))
After searching a while, i got to know about onNewIntent method. But it is also not working.
so how could i make my app to access this file with extension ".swt"?