twitter.com/#!/ link will be handled.
This commit is contained in:
parent
134cbeb916
commit
b249439e10
|
@ -105,7 +105,7 @@ public class TwitterLinkHandlerActivity extends Activity implements Constants {
|
|||
finish();
|
||||
return;
|
||||
}
|
||||
final Uri uri = data.buildUpon().authority(AUTHORITY_TWITTER_COM).build();
|
||||
final Uri uri = regulateTwitterUri(data);
|
||||
final Intent handledIntent = getHandledIntent(uri);
|
||||
if (handledIntent != null) {
|
||||
startActivity(handledIntent);
|
||||
|
@ -126,6 +126,16 @@ public class TwitterLinkHandlerActivity extends Activity implements Constants {
|
|||
finish();
|
||||
}
|
||||
|
||||
private static Uri regulateTwitterUri(Uri data) {
|
||||
final String encodedFragment = data.getEncodedFragment();
|
||||
if (encodedFragment != null && encodedFragment.startsWith("!/")) {
|
||||
return regulateTwitterUri(Uri.parse("https://twitter.com" + encodedFragment.substring(1)));
|
||||
}
|
||||
final Uri.Builder builder = data.buildUpon();
|
||||
builder.authority(AUTHORITY_TWITTER_COM);
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
private Intent getHandledIntent(final Uri uri) {
|
||||
final List<String> pathSegments = uri.getPathSegments();
|
||||
switch (URI_MATCHER.match(uri)) {
|
||||
|
|
Loading…
Reference in New Issue