小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

android如何添加桌面圖標(biāo)和卸載程序后自動刪除圖標(biāo)

 WindySky 2016-03-01

標(biāo)簽:

android如何添加桌面圖標(biāo)和卸載程序后自動刪除桌面圖標(biāo),這是一個應(yīng)用的安裝與卸載過程對桌面圖標(biāo)的操作,下面與大家分享下具體是如何實(shí)現(xiàn)的,感興趣的朋友可以參考下哈

1:創(chuàng)建圖標(biāo)如下 

Intent intent = new Intent(); 
intent.setClass(this, SplashActivity.class); 
Intent addShortcut = new Intent(ACTION_ADD_SHORTCUT); 
Parcelable icon = Intent.ShortcutIconResource.fromContext(this, 
R.drawable.icon); 
addShortcut.putExtra(Intent.EXTRA_SHORTCUT_NAME, getString(R.string.app_name)); 
addShortcut.putExtra(Intent.EXTRA_SHORTCUT_INTENT, intent); 
addShortcut.putExtra("duplicate", 0); 
addShortcut.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, icon); 
sendBroadcast(addShortcut); 

2:刪除圖標(biāo)如下 

Intent intent = new Intent(); 
intent.setClass(this, SplashActivity.class); 
intent.setAction("android.intent.action.MAIN"); 
intent.addCategory("android.intent.category.LAUNCHER"); 
Intent addShortcut = new Intent(ACTION_ADD_SHORTCUT); 
Parcelable icon = Intent.ShortcutIconResource.fromContext(this, 
R.drawable.icon); 
addShortcut.putExtra(Intent.EXTRA_SHORTCUT_NAME, getString(R.string.app_name)); 
addShortcut.putExtra(Intent.EXTRA_SHORTCUT_INTENT, intent); 
addShortcut.putExtra("duplicate", 0); 
addShortcut.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, icon); 
sendBroadcast(addShortcut); 
intent.setAction("android.intent.action.MAIN"); 
intent.addCategory("android.intent.category.LAUNCHER"); 

需要兩個過濾屬性

android如何添加桌面圖標(biāo)和卸載程序后自動刪除圖標(biāo)

標(biāo)簽:

    本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多