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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:23:30+00:00 2026-06-15T05:23:30+00:00

I have a parent activity that calls a child Activity and in onActivityResult() I

  • 0

I have a parent activity that calls a child Activity and in onActivityResult() I get a ResourceNotFound exception when it tries to setContentView(R.drawable.color_syncing). I can do
other manipulations of the View but can’t use any resource from R. Any idea why?

In main class..

Intent wifiHelperIntent = new Intent(context,WifiHandlerActivity.class);
startActivityForResult(wifiHelperIntent, WIFI_HANDLER_SUB_ACTIVITY_ID);

In the child class:

private void doFinish() {
log("Finishing wifi...");
setResult(RESULT_OK);
finish();
}

Then back in the main class: onActivityResult:

public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    switch (requestCode) {
        case WIFI_HANDLER_SUB_ACTIVITY_ID:
            MonollaLog.log("In onActivityResult from WIFI_HANDLER");
            setContentView(R.drawable.color_syncing);
            return;
        default:
            throw new RuntimeException("Unrecognized sub activity request code: "
                    + requestCode);
        }       
}

Error stack trace: [I successfully use this file before the sub activity started]

11-28 14:56:26.312: E/AndroidRuntime(27346): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=1, data=null} to activity {com.monolla.mfbcolor/com.monolla.mfbcolor.MainActivity}: android.content.res.Resources$NotFoundException: File res/drawable/color_syncing.jpg from xml type layout resource ID #0x7f020003

  • 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-15T05:23:32+00:00Added an answer on June 15, 2026 at 5:23 am

    setContentView(R.layout.main); , you passed a drawable instead of a layout.

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

Sidebar

Related Questions

How I can get name of parent activity in child activity. I have two
I have an Activity that calls setContentView with this XML: <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=fill_parent
I have parent/child relationship set up via Node Reference. A Child record can have
I have a parent project that is branched to many dependent child projects. I
I currently have a gridview that returns an images position/id to a parent activity.
I have a Parent activity which is sending data to child activity but the
I have two activities a parent and a child activity but the child activity
So I have a fairly complex activity the parent being a linearlayout with a
If you have Parent has_many :children Child Is there any reason a foreign key
I use Entity Framework 4 and I have parent - child relation with Cascade

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.