Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8483257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:02:52+00:00 2026-06-10T20:02:52+00:00

I am looking for a solution for quite a while and I am getting

  • 0

I am looking for a solution for quite a while and I am getting frustrated more and more.

I want my app to be able to provide content for other apps. For example: When using GoogleMail app you can add an attachment. A dialog will be opened showing all apps that can provide an file for the attachment. My app is in the dialog already, because I defined an activity with an intent-filter like this:

    <intent-filter >
            <action android:name="android.intent.action.GET_CONTENT" />
            <action android:name="android.intent.action.PICK" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.OPENABLE" />
            <data android:mimeType="image/*" />
        </intent-filter>

So when you pick my app, it is starting the activity. The activity allows the user to select a photo and writes it to SD-card. So far so good.
But how do I return it correctly? Because the attachment in GoogleMail is never made.
I am returning it this way:

if(file!=null)
{
  Intent resultIntent=new Intent();
  resultIntent.setType("image/jpg");  

  Uri uri=Uri.fromFile(file);

  //uri=Uri.parse(uri.toString().replace("file", "content"));
  resultIntent.putExtra(Intent.EXTRA_STREAM, uri); 
  resultIntent.putExtra(Intent.EXTRA_UID, uri); 
  resultIntent.setData(uri);
  setResult(RESULT_OK, resultIntent);
  finish();
}

I would be so so so so happy if anybody could help me. I believe it is a simple thing I am doing wrong, but I can’t find anything that helps me. 🙁

Best regards

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T20:02:54+00:00Added an answer on June 10, 2026 at 8:02 pm

    You’ll probably need to implement a stream provider. There really isn’t any good guide out there, but this is the closest I could find.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been looking for quite a while already and still couldn't find a solution
I am quite new to image processing and I am looking for a solution
I've been looking around quite a while now for an answer but since I'm
I'm looking for solution how can run Ruby script without invoking it directly like
I'm looking for solution to extract some node from large xml file (using xmlstarlet
I'm looking for solution to get time to click on element using implicitlyWait in
I'm looking for solution for a in memory script cache, using Zend_Cache and zend
I'm looking after a solution to prevent object release in storyboard views. Here is
I am looking for a solution to display many items (10's of thousands) in
I was looking for some solution around here and I didnt find any correct

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.