-2

So, there are apps that can create shortcuts on the home screen. My question is, How can my app opens/runs/starts a certain shortcut?

if I have 2 browser shortcuts, each of them loads a different url ... how can I choose between them? how to choose to open the 1st or the second one?

a fair player
  • 11,530
  • 9
  • 46
  • 48

1 Answers1

0

To open a URL/website you do the following:

String url = "http://www.example.com";
Intent mIntent = new Intent(Intent.ACTION_VIEW);
mIntent.setData(Uri.parse(url));
startActivity(mIntent);

Here's the documentation of Intent.ACTION_VIEW.

Sagar Pilkhwal
  • 3,998
  • 2
  • 25
  • 77