Android Share custom file
<p>I created my own file extension (<strong>.oli</strong>). If the user clicks on a file with this extension my app starts and loads the included data. This works like expected. The problem is I would like to give the user of my app the opportunity to share a file (Example: filename.oli).   </p>

<p>I implemented this so far:</p>

<pre><code>public void shareFile(){
        File file = getShareableFile(); //Creates a .oli-file
        Intent shareIntent = new Intent(Intent.ACTION_SEND);
        Uri uri = Uri.fromFile(file);
        shareIntent.setType("*/*"); //Maybe the problem
        shareIntent.putExtra(Intent.EXTRA_STREAM, uri);
        shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, name);
        startActivity(Intent.createChooser(shareIntent, getString(R.string.shareDatei)));
}
</code></pre>

<p>The problem is, the list of apps that think they could handle sharing my file is very large because of shareIntent.setType("/"); Here are two cases that happen if you share with different apps:</p>

<p>If I choose an Email-app like Gmail to share my file it works how it should. The email includes the file as filename.oli . When I click on it my app gets started.</p>

<p>But If I choose for example the Quickmemo-app I get a message that this file can not be shared by this.</p>

<p>So all in all I just want to show apps in the chooserlist that can handle to share my file with the .oli extension . How do I do that? Thanks in advance!</p>