Skip to content

Instantly share code, notes, and snippets.

@AlexHedley
Last active August 29, 2015 14:14
Show Gist options
  • Select an option

  • Save AlexHedley/7fb8cbea4a69743cb7e2 to your computer and use it in GitHub Desktop.

Select an option

Save AlexHedley/7fb8cbea4a69743cb7e2 to your computer and use it in GitHub Desktop.
Android - Custom URL Scheme
//XXX://settings/?d=hello
Intent intent = getIntent();
if (Intent.ACTION_VIEW.equals(intent.getAction())) {
Uri data = intent.getData();
Log.d(TAG, "URI Data: " + data.toString());
String d = data.getQueryParameter("d");
Log.d(TAG, "d:" + d);
}
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="XXX" />
</intent-filter>