Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Have a look at Intent Filters: <a href="http://developer.android.com/guide/components/intents-filters.html" rel="nofollow">http://developer.android.com/guide/components/intents-filters.html</a></p> <p>Specifically, I think you'll find the Note Pad Example helpful: <a href="http://developer.android.com/guide/components/intents-filters.html#npex" rel="nofollow">http://developer.android.com/guide/components/intents-filters.html#npex</a></p> <p>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:</p> <pre><code>&lt;activity android:name=".(ActivityName)" android:label="@string/app_name" android:exported="true" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;intent-filter&gt; &lt;action android:name="com.google.android.apps.drive.DRIVE_OPEN" /&gt; &lt;action android:name="android.intent.action.VIEW" /&gt; &lt;action android:name="android.intent.action.EDIT" /&gt; &lt;action android:name="android.intent.action.INSERT" /&gt; &lt;category android:name="android.intent.category.DEFAULT" /&gt; &lt;data android:mimeType="text/*" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; </code></pre> <p>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.</p> <p>To make it actually handle opening the files, you need to add something like this to your onCreate in the activity:</p> <pre><code>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... </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload