Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open a file with my android App

I'm developing an app, and I need the user to be able to open my app for example when an attached file is clicked from the gmail app, or from the downloads folder, or from the "File Explorer".

I've already been googling a lot and even found some questions here in SO, but I can't make this work.

This is how my Manifest.xml file looks like:

<receiver android:name="MySMS2CloudReceiver"> 
<intent-filter> 
    <action android:name="android.intent.action.ACTION_VIEW" /> 
    <action android:name="android.intent.action.ACTION_EDIT" /> 
    <action android:name="android.intent.action.ACTION_PICK" /> 
    <data android:scheme="http" /> 
    <data android:pathPattern=".*\\.xml" />    
    <data android:host="*" /> 
    <data android:mimeType="application/rss+xml" />
    <data android:mimeType="application/atom+xml" />
    <data android:mimeType="application/xml" />
    <data android:mimeType="text/xml" />
</intent-filter>    
</receiver> 

My broadcast receiver:

public class MySMS2CloudReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        Log.d("MySMS2CloudReceiver", "Leaving onReceived...");
    }
}

But right now, when I click an attached file from an email in the pop up with the title "Complete Action Using" my app is not even listed there...

Any idea of what maybe happening?

Thanks!!

like image 624
Andres Avatar asked Jun 29 '13 17:06

Andres


1 Answers

Personally, I haven't done this before, but have you tried this solution?

Why isn't my app on the list of apps to open txt file?

like image 149
Android Noob Avatar answered Oct 13 '22 01:10

Android Noob