I have a zip file which was downloaded from url and its path is set to /storage/emulated/0/myapp/downloadedfile.zip
Now I would like to open this zip file via choose intent to list the available apps to open the downloaded file.
I have set this in manifest:
<activity
android:name=".MyApp"
android:alwaysRetainTaskState="true"
android:launchMode="singleInstance"
android:theme="@style/MyMaterialTheme">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="application/zip"/>
</intent-filter>
</activity>
Now I'm calling this way to open the intent chooser
File downloadedfile = new File(Environment.getExternalStoragePublicDirectory(Environment.getExternalStorageDirectory() + "/myapp") + "/" + "downloadedfile.zip");
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(downloadedfile), "application/zip");
startActivity(intent);
This works fine if I have ESFileExplorer
has already installed on my app
But I would like to check if there is any pre-installed app is available or else I need to show playstore
also as one of the option so that user can download the app and install the ESFileExplorer app.
So how do I do that ?