Last active
August 29, 2015 14:14
-
-
Save AlexHedley/7fb8cbea4a69743cb7e2 to your computer and use it in GitHub Desktop.
Android - Custom URL Scheme
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //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); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <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> |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://developer.android.com/training/basics/intents/filters.html
http://stackoverflow.com/questions/2448213/how-to-implement-my-very-own-uri-scheme-on-android
http://stackoverflow.com/questions/17063696/android-app-how-to-read-get-parameters-from-a-custom-url-scheme