Skip to content

Instantly share code, notes, and snippets.

@tolmachevroman
Created February 5, 2015 13:02
Show Gist options
  • Save tolmachevroman/ea7d2254b1f18d66657f to your computer and use it in GitHub Desktop.
Save tolmachevroman/ea7d2254b1f18d66657f to your computer and use it in GitHub Desktop.
Open Url using custom Scheme
<!-- http://development.server.com/confirmations/eMkVMRppXUbV5F8Xd17W from browser address bar -->
<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:host="development.server.com"
android:scheme="http" />
</intent-filter>
</activity>
if(getIntent().getData() != null) {
Uri link = getIntent().getData();
String confirmationToken = link.toString().split("confirmations/")[1];
Log.d("Confirmation token", confirmationToken);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment