我的应用程序添加到的&QUOT名单;完成操作使用"在Gmail附件 [英] Add my app to the list of "Complete Action Using" for attachments in gmail

查看:198
本文介绍了我的应用程序添加到的&QUOT名单;完成操作使用"在Gmail附件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想我的应用程序出现在Gmail中的列表中。这份名单出现,当我点击Gmail应用中的preVIEW按钮。

I would like my app to appear in the list within gmail. This list comes up when I click the Preview button within the Gmail app.

我想知道需要在意图过滤器要添加哪些条目?

I would like to know what entries need to be added in the intent filter?

感谢您提前帮助。

推荐答案

看一看意图过滤器:
http://developer.android.com/guide/components/intents-filters.html

具体来说,我想你会发现笔记本为例有所帮助:
http://developer.android.com/guide/components/intents-filters html的#npex

Specifically, I think you'll find the Note Pad Example helpful: http://developer.android.com/guide/components/intents-filters.html#npex

就个人而言,我在几个小时前有这个相同的问题。我需要打开我的应用程序的文本文件。要做到这一点,我不得不把它添加到我的清单:

Personally, I had this same exact issue a few hours ago. I needed to open text files with my app. To do so, I had to add this to my manifest:

<activity
    android:name=".(ActivityName)"
    android:label="@string/app_name"
    android:exported="true" >
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    <intent-filter>
        <action android:name="com.google.android.apps.drive.DRIVE_OPEN" />
        <action android:name="android.intent.action.VIEW" />
        <action android:name="android.intent.action.EDIT" />
        <action android:name="android.intent.action.INSERT" />
        <category android:name="android.intent.category.DEFAULT" />
        <data android:mimeType="text/*" />
    </intent-filter>
</activity>

通过如此,我能够让我的应用程序出现在可用的应用程序从天文打开文本文件的列表,并允许它启动。

With just this, I was able to make my app appear in the list of available applications to open text files from Astro, and allow it to be launched.

要使它真正处理打开的文件,你需要像这样的活动添加到您的onCreate:

To make it actually handle opening the files, you need to add something like this to your onCreate in the activity:

Intent intent = getIntent();
Action action = intent.getAction();
if (action.equals("com.google.android.apps.drive.DRIVE_OPEN")) {
    // Handle the intent from google drive...
} else if (action.equals("android.intent.action.VIEW")) {
    // Handle the intent to view the file...
} else // And so on...

这篇关于我的应用程序添加到的&QUOT名单;完成操作使用&QUOT;在Gmail附件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆