마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

shortcut 사용하여 바탕화면아이콘!!!!!!!!!!!!!!!!!!

0 추천
제가 지금 shortcut을 사용하여서 바탕화면에 아이콘을 자동생성시켰습니다.
그럼 그 생성된아이콘을 클릭시 url을 혹시 다음이나 네이버로 연결시킬수있을까요?
 
 private static final String EXTRA_KEY = "패키지명";
 @Override
 public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  Intent shortcutIntent = new Intent(Intent.ACTION_MAIN);
  shortcutIntent.setClassName(this, this.getClass().getName());
  shortcutIntent.putExtra(EXTRA_KEY, "ApiDemos Provided This Shortcut");
  Intent intent = new Intent("com.android.launcher.action.INSTALL_SHORTCUT");
  intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
  intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, getString(R.string.app_name));
  intent.putExtra("duplicate", false);
  
  Parcelable iconResource = Intent.ShortcutIconResource.fromContext(this, R.drawable.ad_icon);
  intent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, iconResource);
  sendBroadcast(intent);
 
khmresh (140 포인트) 님이 2013년 6월 10일 질문

2개의 답변

0 추천
이게 답인지는 모르겠지만, manifest에서 처음페이지로 설정해주시고,

웹뷰를 이용해서 네이버나 다음을 url 주시면 될듯 합니다.
안드로메다개발자 (8,830 포인트) 님이 2013년 6월 10일 답변
0 추천
Manifest에

<uses-permission android:name="android.permission.INTERNET" />

추가해주시구요

 

Intent shortcutIntent = new Intent(   Intent.ACTION_VIEW, Uri.parse("http://www.naver.com")   );

이런식으로 사용하시면 될것같아요
스페 (250 포인트) 님이 2013년 6월 11일 답변
...