Tuesday, August 2, 2011

[android-developers] How to make icon of app on desktop? Problems with WebView

Hi, guys!

In my app I have one activity with WebView.
When I push Home button and then click on icon my app -- web page do
not reload - it is good.
But in code I create icon manually:

private void createIcon(int iconId){
final Intent shortcutIntent = new Intent(Intent.ACTION_MAIN);
ComponentName name = new ComponentName(getPackageName(),
".FullScreenBrowserActivity");
shortcutIntent.setComponent(name);
shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);

Intent addIntent = new Intent();
addIntent.putExtra(Intent.EXTRA_SHORTCUT_INTENT,
shortcutIntent);
addIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME, "Fulscreen
Browser");
addIntent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE,
Intent.ShortcutIconResource.fromContext(this, iconId));


addIntent.setAction("com.android.launcher.action.INSTALL_SHORTCUT");
this.sendBroadcast(addIntent);
}

When I click this icon - app starts new copy of themselfs and webpage
starts loading.

How to make new icon on desktop manual(after install) and when click
on icon - webpage in WebView do no reloading?

Thanks!

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate