Dear all,

I would like to send a link in an email to trigger the launch of an
Activity.
As for now, with the following link and intent-filter, it works very
well within the default Browser but not in the default Email
application.

HTML link
<a
href="intent:#Intent;action=com.mycompany.project.MY_ACTION;package=com.mycompany.project;end">click
here to launch</a>

intent-filter
<intent-filter>
    <action android:name="com.mycompany.project.MY_ACTION" />
    <category android:name="android.intent.category.DEFAULT"/>
    <category android:name="android.intent.category.BROWSABLE"/>
</intent-filter>

I suspect the code in packages/apps/Email/src/com/android/email/
activity/MessageView.java around line 547 to be the cause of the
issue :
      public boolean shouldOverrideUrlLoading(WebView view, String
url) {
            // Handle most uri's via intent launch
            boolean result = false;
            Intent intent = new Intent(Intent.ACTION_VIEW,
Uri.parse(url));
            intent.addCategory(Intent.CATEGORY_BROWSABLE);
            intent.putExtra(Browser.EXTRA_APPLICATION_ID,
getPackageName());
 
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
            try {
                startActivity(intent);
.....
    }

Instead of using Intent.parseUri(url, Intent.URI_INTENT_SCHEME); like
in  BrowserActivity.java (around line 2654) which permits to use
custom action, the Intent action is forced to be Intent.ACTION_VIEW
and the custom action can not be resolved.

Is this a known issue or am I missing something about custom action
and Intents?
Does any workaround exist to get this behavior within the Email client
without using a custom scheme?

Thanks

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to