I have an app which shares and receive images from other apps. I have two problems here
- On sharing Image from some other place let say from gallery my app is showing but with its whole package name i.e. com.test.myapp instead of only with the app name
here is the manifest of it
<activity
android:name=".newdesign.SplashActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
</activity>
- Secondly, Ion sharing the image from my app I don't want to display my own app on the share dialog, but when I remove my app I get some unwanted system apps along with some app with default android icons.
here is the sharing code
List<Intent> targetedShareIntents = new ArrayList<Intent>();
Intent share = new Intent(android.content.Intent.ACTION_SEND);
share.setType("image/*");
List<ResolveInfo> resInfo = ExportOrSaveActivity.this.getPackageManager().queryIntentActivities(createShareIntent(), 0);
if (!resInfo.isEmpty()) {
for (ResolveInfo info : resInfo) {
Intent targetedShare = createShareIntent();
if (!info.activityInfo.packageName.equalsIgnoreCase("com.test.myapp1") && !info.activityInfo.packageName.equalsIgnoreCase("com.test.myapp2")) {
targetedShare.setPackage(info.activityInfo.packageName);
targetedShareIntents.add(targetedShare);
}
}
Intent chooserIntent = Intent.createChooser(targetedShareIntents.remove(0),
"Select app to share");
chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS,
targetedShareIntents.toArray(new Parcelable[] {}));
startActivity(chooserIntent);
Thanks in advance