Skip to content

Commit be4f3d9

Browse files
committed
Improve javadocs in ShareUtils
1 parent 24ff6a4 commit be4f3d9

File tree

1 file changed

+15
-9
lines changed
  • app/src/main/java/org/schabi/newpipe/util/external_communication

1 file changed

+15
-9
lines changed

app/src/main/java/org/schabi/newpipe/util/external_communication/ShareUtils.java

+15-9
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,15 @@ public static void installApp(@NonNull final Context context, final String packa
6060

6161
/**
6262
* Open the url with the system default browser. If no browser is set as default, falls back to
63-
* {@link #openAppChooser(Context, Intent, boolean)}. This function selects the package to open
64-
* based on which apps respond to the {@code http://} schema alone, which should exclude special
65-
* non-browser apps that are can handle the url (e.g. the official YouTube app). Therefore
66-
* please <b>prefer {@link #openUrlInApp(Context, String)}</b>, that handles package resolution
67-
* in a standard way, unless this is the action of an explicit "Open in browser" button.
63+
* {@link #openAppChooser(Context, Intent, boolean)}.
64+
* <p>
65+
* This function selects the package to open based on which apps respond to the {@code http://}
66+
* schema alone, which should exclude special non-browser apps that are can handle the url (e.g.
67+
* the official YouTube app).
68+
* <p>
69+
* Therefore <b>please prefer {@link #openUrlInApp(Context, String)}</b>, that handles package
70+
* resolution in a standard way, unless this is the action of an explicit "Open in browser"
71+
* button.
6872
*
6973
* @param context the context to use
7074
* @param url the url to browse
@@ -120,8 +124,9 @@ public static void openUrlInApp(@NonNull final Context context, final String url
120124
}
121125

122126
/**
123-
* Open an intent with the system default app. Use {@link #openIntentInApp(Context, Intent)} to
124-
* show a toast in case of failure.
127+
* Open an intent with the system default app.
128+
* <p>
129+
* Use {@link #openIntentInApp(Context, Intent)} to show a toast in case of failure.
125130
*
126131
* @param context the context to use
127132
* @param intent the intent to open
@@ -138,8 +143,9 @@ public static boolean tryOpenIntentInApp(@NonNull final Context context,
138143
}
139144

140145
/**
141-
* Open an intent with the system default app, showing a toast in case of failure. Use {@link
142-
* #tryOpenIntentInApp(Context, Intent)} if you don't want the toast. Use {@link
146+
* Open an intent with the system default app, showing a toast in case of failure.
147+
* <p>
148+
* Use {@link #tryOpenIntentInApp(Context, Intent)} if you don't want the toast. Use {@link
143149
* #openUrlInApp(Context, String)} as a shorthand for {@link Intent#ACTION_VIEW} with urls.
144150
*
145151
* @param context the context to use

0 commit comments

Comments
 (0)