On Thu, Sep 1, 2011 at 4:21 PM, treyb <[email protected]> wrote:
> I have an app that I want to run as a service and when you go to open
> a document (pdf, doc or xls) it will give you the option to open it in
> quickoffice or my app.
>
> How do I accomplish this?
This makes no sense.
If you replace "service" with "activity", then it makes sense, and you
accomplish that via right MIME type in the <data> element of the
activity's <intent-filter>.
<activity android:name="DoYouReallyThinkYouCanWriteSuchAnActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<data android:mimeType="..." />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
(where the ... is replaced by a MIME type for the document file format)
You do not open a document with a service any more than you open a
document with a snowplow.
--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy
Android Training in NYC: http://marakana.com/training/android/
--
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