ダイレクトシェア機能を使いたいのですが、アプリを除外する必要があります。アプリを除外して直接共有することはできますか?
除外部分はうまくいきます。私はちょうどその選択肢に一連のインテントを与えていますが、インテントには特定のアプリケーションが1つしか含まれていません。
しかし、この直接共有を行うことは機能しません。
ダイレクトシェアは、チューザにちょうど1つのインテントを与えるときに機能しているようです。
アプリを除外してダイレクトシェアを使用することはできますか?
コードスニペット:意図(How to filter specific apps for ACTION_SEND intent (and set a different text for each app))のリストを共有
:
final Intent chooserIntent = Intent.createChooser(targetShareIntents.remove(0), "Share with: ");
chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, targetShareIntents.toArray(new Parcelable[]{}));
activity.startActivity(chooserIntent);
directshareとの共有、ない除く:
final Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send.");
sendIntent.setType("text/plain");
activity.startActivity(Intent.createChooser(sendIntent, "Share with:"));