Browse Source

Add missing method documentation

master
Anthony Restaino 9 years ago
parent
commit
04e0d5650f
  1. 15
      app/src/main/java/acr/browser/lightning/utils/Utils.java

15
app/src/main/java/acr/browser/lightning/utils/Utils.java

@ -382,7 +382,20 @@ public final class Utils {
canvas.drawPath(wallpath, paint); canvas.drawPath(wallpath, paint);
} }
public static void createShortcut(@NonNull Activity activity, HistoryItem item) { /**
* Creates a shortcut on the homescreen using the
* {@link HistoryItem} information that opens the
* browser. The icon, URL, and title are used in
* the creation of the shortcut.
*
* @param activity the activity needed to create
* the intent and show a snackbar message
* @param item the HistoryItem to create the shortcut from
*/
public static void createShortcut(@NonNull Activity activity, @NonNull HistoryItem item) {
if (TextUtils.isEmpty(item.getUrl())) {
return;
}
Log.d(Constants.TAG, "Creating shortcut: " + item.getTitle() + ' ' + item.getUrl()); Log.d(Constants.TAG, "Creating shortcut: " + item.getTitle() + ' ' + item.getUrl());
Intent shortcutIntent = new Intent(activity, MainActivity.class); Intent shortcutIntent = new Intent(activity, MainActivity.class);
shortcutIntent.setData(Uri.parse(item.getUrl())); shortcutIntent.setData(Uri.parse(item.getUrl()));

Loading…
Cancel
Save