private void makeShordtCut()
{
Bitmap icon = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher);
Intent shortcutIntent = new Intent(Intent.ACTION_VIEW);
shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
// shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
// shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
//shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
// shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
String goPage = "http://ss.com?id=9;
Uri myUri = Uri.parse(goPage);
shortcutIntent.setData(myUri);
Intent intent = new Intent();
intent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
intent.putExtra(Intent.EXTRA_SHORTCUT_NAME, "asdfgggg");
intent.putExtra(Intent.EXTRA_SHORTCUT_ICON, icon);
intent.setAction("com.android.launcher.action.INSTALL_SHORTCUT");
intent.putExtra("duplicate", false);
if (icon != null)
{
sendBroadcast(intent);
}
}
위와 같은 코드로 홈화면에 아이콘을 만들었습니다.
최초 한번열었을때는 정상적으로 요청하는데, 두번째 누르면 아까 요청했던 페이지가 열리고 그상태로 멍때리고 있습니다.
pc에서도 자주보던 현상인데, 파라미터까지 동일한 url때문에 다시 요청하지 않는것으로 보입니다.
pc에서는 뒤에다가 시스템시간같은걸 붙여서 해결했는데 아이콘이다 보니 그것 역시 픽스되기 때문에 .... 안되는군요
인텐트 플레그를 줘봐도 동일합니다.
아이콘의 이동하는 URL이 동일해도 항상 다시 요청할 수 있는 방법없을까요?
(삼성브라우저는 대부분 이렇구요, 일부폰에서는 인자까지 같아도 계속 다시 요청하더군요)