Add click handler to links
This commit is contained in:
parent
3eb2a5eb96
commit
0898db3490
@ -460,9 +460,22 @@ public class AppDetails2 extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void onLinkClicked(String url) {
|
private void onLinkClicked(String url) {
|
||||||
|
if (!TextUtils.isEmpty(url)) {
|
||||||
|
tryOpenUri(url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void tryOpenUri(String s) {
|
||||||
|
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(s));
|
||||||
|
if (intent.resolveActivity(getPackageManager()) == null) {
|
||||||
|
Toast.makeText(this,
|
||||||
|
getString(R.string.no_handler_app, intent.getDataString()),
|
||||||
|
Toast.LENGTH_LONG).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
|
||||||
// The HTML formatter adds "\n\n" at the end of every paragraph. This
|
// The HTML formatter adds "\n\n" at the end of every paragraph. This
|
||||||
// is desired between paragraphs, but not at the end of the whole
|
// is desired between paragraphs, but not at the end of the whole
|
||||||
|
Loading…
x
Reference in New Issue
Block a user