Java tutorial
//package com.java2s; // Use of this source code is governed by a BSD-style license that can be import android.content.Context; import android.content.Intent; import android.net.Uri; public class Main { public static final String REUSE_URL_MATCHING_TAB_ELSE_NEW_TAB = "REUSE_URL_MATCHING_TAB_ELSE_NEW_TAB"; /** * Shortcut intent for icon on homescreen. * @param context Context used to create the intent. * @param url Url of the bookmark. * @return Intent for onclick action of the shortcut. */ public static Intent createShortcutIntent(Context context, String url) { Intent shortcutIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); shortcutIntent.putExtra(REUSE_URL_MATCHING_TAB_ELSE_NEW_TAB, true); return shortcutIntent; } }