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 8632921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:25:04+00:00 2026-06-12T09:25:04+00:00

I use Intent.ACTION_SEND for receiving data in my app. How can I process sending

  • 0

I use Intent.ACTION_SEND for receiving data in my app. How can I process sending of data type text/x-vcard?

When I use intent.getStringExtra(Intent.EXTRA_TEXT), it’s throws an exception.

  • 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-12T09:25:04+00:00Added an answer on June 12, 2026 at 9:25 am

    This worked for me:

    Uri uri = (Uri) intent.getExtras().get(Intent.EXTRA_STREAM);
    

    uri.toString() gave me this:

    content://com.android.contacts/contacts/as_multi_vcard/2876r7-2A962A902A9045494F35.1957ifcf79ef7e82a0b99%3A2876r8-315551534945354F312D4F35.1957ieb4f1a6b0fcb82b9%3A2876r9-57493D3135452D3D43.1957ief585d48b64784c0%3A2876r10-4F35373D4343474959.1957if0a70009608fae23%3A2876r11-313B3531412F2D432D473135.1957i39c8fd1b6ef69e84%3A1957i51f47cecc7822f19.4035i611323cd8d55aa13%3A4035i8.4035i74aa09b30a019fa1%3A4035i2c0b359c8a47878e%3A4035i6d3c40138feef64b%3A4035i7d583f5488e47e41%3A4035ia6.4035i5%3A4035i6029e050898a86d3%3A4035i77caf53c89b4da48%3A4035i2a11745a8f3d5667%3A4035i9%3A4035i59ab32fd0fa955a9%3A4035i7391f1908a38ed1b%3A4035i6769848b08a214b0%3A4035i5a7c03c88bd1ba9e%3A4035i126427da8dfc0763%3A4035i35003ea5093abeb0%3A4035i1906758a8e16ca3a%3A4035i59a7953d883a78bf%3A4035i64249c098820452a%3A4035i48145af48ed78ebc%3A4035i2093d7568be9dff6%3A4035i469c62120db59d35.4035i388017020fbfb07e%3A4035i47e19c048aa116d7%3A239i3%3A239i2%3A239i249%3A239i248%3A239i1,
    

    which is not terribly useful in that form, but there seem to be several posts on stack about getting a usable path from a URI.

    To get the text from the vcard, the following seems to be working for me:

    ContentResolver cr = getContentResolver();
    InputStream stream = null;
    try {
        stream = cr.openInputStream(uri);
    } catch (FileNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    
    StringBuffer fileContent = new StringBuffer("");
    int ch;
    try {
        while( (ch = stream.read()) != -1)
          fileContent.append((char)ch);
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    String data = new String(fileContent);
    Log.i("TAG", "data: " + data);
    

    The string will have carriage returns, so to see all of the text in the logcat, make sure to search for the tag (in the above code it’s “TAG”), so you see all the lines (see my screenshot below).

    Screenshot of logcat

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

Sidebar

Related Questions

In my app, I use a PreferenceActivity framework to store persistent data. My intent
In my app i want to be able to use the ACTION_SEND intent to
i can pick a image and its path using intent. with the use of
I know I can use android build in email app when I use the
I've successfully being able to use the ACTION_SEND intent which displays my application in
Now i can use the share intent to open the share dialog Intent intent
We all know how we can use intent-filters in our AndroidManifest.xml to declare capabilities
I wanted to register an intent-filter on my app so I can share a
Every example I find of anyone implementing plugins in android seems to use aexp.intent.action.
How to use intent to prompt user to choose finish action with to choosing

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.