Intent addIntent  = new Intent("com.android.launcher.action.INSTALL_SHORTCUT");
String title = getResources().getString(R.string.title_activity_result);
Parcelable icon = Intent.ShortcutIconResource.fromContext(MainActivity.this, R.drawable.qiang_ac);
Intent intent = new Intent(MainActivity.this,MainActivity.class);
addIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME,title);
addIntent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE,icon);
addIntent.putExtra(Intent.EXTRA_SHORTCUT_INTENT
, intent);
sendBroadcast(addIntent);

安卓应用添加桌面快捷方式

 

相关文章:

  • 2022-12-23
  • 2022-01-07
  • 2022-12-23
  • 2021-07-30
  • 2022-01-08
  • 2022-01-12
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-20
  • 2021-11-29
  • 2022-12-23
  • 2022-12-23
  • 2021-09-25
相关资源
相似解决方案