I was trying to intercept a google maps intent as the following:
Intent myIntent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("geo:37.423156,-122.084917"));
but I haven't found any example, link or documentation of this. So, I'm thinking that unfortunately is not possible.
In the Manifest file I put several intent filters. Specially I think that the next intent filter must match with the mentioned intent.
<intent-filter>
<action android:name="android.content.Intent.ACTION_VIEW" />
<data android:scheme="geo"/>
</intent-filter>
In addition I tried to investigate what activities match with this particular intent by means of:
List resolves = getPackageManager().queryIntentActivities(myIntent, 0 );
ResolveInfo firstRevolve=(ResolveInfo) resolves.get(0);
IntentFilter myIF=firstRevolve.filter;
Nevertheless only MapsActivity matches with the intent, not my Activity, and surprisingly myIF is null, so that I can't obtain the intent filter that the google maps activity uses.
In addition I installed "Intent Intercept" from Android Market, but it does not capture this intent.
So, I need some help/idea. Somebody knows what is happening? In my opinion Google restricts this interceptions but this restriction is not specified.
Any help will be appreciated. Best regards, Pablo.
The code example below is just working fine in my project.
<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="https" android:host="maps.google.com" />
<data android:scheme="geo" />
</intent-filter>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With