はい、API21から順に、TaskDescription
APIを使用して、最近のApps画面でアプリの表現をカスタマイズすることができます。
あなただけのアイコンを気にする場合は、基本的にどこでもActivity
内から下にこのスニペットを使用することができます。
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
setTaskDescription(
new ActivityManager.TaskDescription(
null, // Leave the default title.
R.drawable.the_icon_you_want,
null // Leave the default color
)
}
しかし、あなたが最近使ったアプリ画面上のアプリのプレゼンテーションがあることに注意してくださいする必要があります最後に確定したTaskDescription
によって決定されます。この問題についてビッグオタクランチの素晴らしい記事から引用したよう
:
By default, the TaskDescription is based on the activity at the base of the task’s activity stack. Other activities that pile on will not affect the styling, unless those activities have a TaskDescription explicitly set at run time. The topmost activity with a TaskDescription explicitly set will trump the styling specified in the manifest or in activities below in the stack with TaskDescriptions set.
が故に可能な限り最高の結果を達成するために、アプリのMainActivity
のonCreate(..)
メソッド内でそのスニペットを置きたいと思うでしょう。
それは私に 'エラー:互換性のない型を与えます:intはビットマップに変換できません、R.drawable.the_icon_you_want' – BeniBela