我已經嘗試手動在主屏幕上添加書籤。需要一些編程方面的幫助。謝謝。如何在Android主屏幕上添加書籤(URL)
2
A
回答
0
我不確定您的意思是書籤。也許這個教程可以幫助嗎?
http://www.tutorialforandroid.com/2009/04/open-urlwebsite-from-android.html
這是啓動指向一個網頁瀏覽器的應用程序。這是你想到的嗎?
靈光
0
我覺得這是不可能的,因爲如果是,垃圾郵件發送者可以垃圾郵件的主屏幕,鏈接到他們的垃圾:d
0
檢查出來的(不良記錄)動作INSTALL_SHORTCUT。你需要相應的權限,如該鏈接
2
這工作對我解釋 - 添加到許可體現
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
使用下面的代碼:
public void createGoogleSearchShortcut(Context context) {
String urlStr = String.format(context.getString(R.string.homescreen_shortcut_search_url), context.getString(R.string.app_id));
Intent shortcutIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlStr));
// shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
Intent intent = new Intent();
intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
// Sets the custom shortcut's title
intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, context.getString(R.string.search));
// Set the custom shortcut icon
intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, Intent.ShortcutIconResource.fromContext(context, R.drawable.ic_action_search));
intent.putExtra("duplicate", false);
// add the shortcut
intent.setAction("com.android.launcher.action.INSTALL_SHORTCUT");
context.sendBroadcast(intent);
}
請注意:我強烈建議在添加書籤之前詢問用戶。沒有他的許可將書籤添加到他的主屏幕是「不禮貌」...
相關問題
- 1. Android |主屏幕上的書籤圖標
- 2. 如何在主屏幕和子屏幕上添加頁碼
- 3. iOs And Android:在主屏幕上通過javascript創建書籤-shortcut-
- 4. 如何在android主屏幕上添加一個按鈕?
- 5. iPhone書籤鏈接添加到主屏幕?
- 6. jQuery Mobile Detect主屏幕書籤
- 7. iPhone:Safari與「主屏幕」書籤的啓動
- 8. 如何在屏幕上添加UIToolbar?
- 9. 添加到手機上的主屏幕
- 10. symfony android加到主屏幕
- 11. 如何在AS3的屏幕上書寫
- 12. 將圖標添加到Android主屏幕右上角
- 13. Android:將活動添加到主屏幕上的菜單
- 14. 如何增加Android主屏幕上的圖標大小?
- 15. 在Android主屏幕上創建URL快捷方式programmaticlly
- 16. 在Android上獲取主屏幕位置
- 17. 如何在主屏幕上執行MessageBox.Show?
- 18. 的Android:主屏幕
- 19. 在android主屏幕小部件中添加Seekbar
- 20. Android - 添加到主屏幕的快捷方式,並指定屏幕和位置
- 21. 將圖標添加到主屏幕上,例如Safari
- 22. 在iOS設備的主屏幕上設置書籤的默認標題?
- 23. 如何在定製的Android主屏幕中添加默認的Widget?
- 24. LightSwitch HTML:將添加/編輯屏幕顯示爲主屏幕
- 25. ApplicationBar在主屏幕上?
- 26. 將小部件添加到主屏幕
- 27. JQuery Mobile添加主屏幕選項?
- 28. 實現「添加到主屏幕」,ala Safari
- 29. 添加到主屏幕Web App
- 30. 如何更改Android主屏幕外觀?
謝謝你的回覆,但我腦海中有一個書籤放置在你的主屏幕上,你可以從那裏啓動網站。如果您在Android中打開瀏覽器並轉到書籤,則實際上可以將該書籤的快捷方式放置到主屏幕上。還有什麼想法?謝謝 – dackyD 2010-11-04 08:29:50