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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:41:37+00:00 2026-06-12T02:41:37+00:00

See my code: doSomeActionWillStartNewIntentToSelectImage(); // check started intent Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.INTERNAL_CONTENT_URI);

  • 0

See my code:

doSomeActionWillStartNewIntentToSelectImage();

// check started intent
Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.INTERNAL_CONTENT_URI);
Assert.assertThat(activity, new StartedMatcher(intent));

// simulate the returning result
shadowOf(activity).receiveResult(
        new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.INTERNAL_CONTENT_URI),
        Activity.RESULT_OK,
        new Intent().setData(activity.drawableId2Uri(R.drawable.icon_ok)));

But it reports an error:

java.lang.RuntimeException: No intent matches 
    Intent{action=android.intent.action.PICK, data=content://media/internal/images/media} among 
   [Intent{action=android.intent.action.PICK, data=content://media/internal/images/media}]
at com.xtremelabs.robolectric.shadows.ShadowActivity.receiveResult(ShadowActivity.java:381)

It’s strange that Intent{action=android.intent.action.PICK, data=content://media/internal/images/media} is exactly the same as the later one.

Where is wrong and how to fix it?

  • 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-12T02:41:39+00:00Added an answer on June 12, 2026 at 2:41 am

    The intent passed into receiveResult is not the same one started by the activity.

    The correct test code should be:

    doSomeActionWillStartNewIntentToSelectImage();
    
    // check started intent
    Intent intent = shadowOf(activity).getNextStartedActivity();
    assertThat(intent.getAction()).isEqualTo(Intent.ACTION_PICK);
    assertThat(intent.getData()).isEqualTo(MediaStore.Images.Media.INTERNAL_CONTENT_URI);
    
    // simulate the returning result
    shadowOf(activity).receiveResult(
            intent,
            Activity.RESULT_OK,
            new Intent().setData(activity.drawableId2Uri(R.drawable.icon_ok)));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For example i see code <<<<<<< HEAD public function login() { if($this->_identity===null) { $this->_identity=new
I'm new in js. I see code example: foo.bar().baz() How described foo bar and
Please see code. return from org in context.Organizations select new { PlaceId = org.OrganizationId,
Please see code below: s = new Socket(nextHopIP, 3434); fileIn = new FileInputStream(fileName); fileOut
On iOS/CocoaTouch I often see code that creates a new instance of NSAutoreleasePool within
Please see code (Using knockout.js over ASP MVC 3): self.tags = ko.utils.arrayMap(@Html.Raw(new JavaScriptSerializer().Serialize(Model.Tags)), function(tag)
I have see code like this Dim s as something = new something Dim
See code just bellow Our generic interface public interface Repository<INSTANCE_CLASS, INSTANCE_ID_CLASS> { void add(INSTANCE_CLASS
See code below: I want Page 1 to alert #testing... This works in C
I see code like this in Android samples all the time? try { ...

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.