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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:39:53+00:00 2026-06-15T18:39:53+00:00

For some reason, I keep receiving the following error: java.lang.IllegalStateException: the specified child already

  • 0

For some reason, I keep receiving the following error:

java.lang.IllegalStateException: the specified child already has a parent. You must call removeView() on the child’s parent view

I am using the following code:

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.listitem);
    //url is fetched from another class
    readWebpage(imdbUrl);
}

private class DownloadWebPageTask extends AsyncTask<String, Void, String> {
    @Override
    protected String doInBackground(String... urls) {

    }

    @Override
    protected void onPostExecute(String result) {
        //textView.setText(result);
        displayMoviesList(result);
    }
}

public void readWebpage(String imdbUrl) {
}

public void displayMoviesList(String result) {
    JSONObject responseObj = null; 
    try {
        responseObj = new JSONObject(result);
        JSONObject Obj = responseObj.getJSONObject("results");
        JSONArray moviesListObj = Obj.getJSONArray("result");

        for(int i=0 ;i<moviesListObj.length();i++) {
            JSONObject e = moviesListObj.getJSONObject(i);
            cover[i] = e.getString("cover");
            title[i] = e.getString("title");
            year[i] = e.getString("year");
            director[i] = e.getString("director");
            rating[i] = e.getString("rating");
            details[i] = e.getString("details");
        }

        tl = (TableLayout) findViewById(R.id.main_table);
        imgView = (ImageView)findViewById(R.id.imageID);
        progressbar = (ProgressBar) findViewById(R.id.loadingBar);
        //new loadImageTask().execute(cover[i].toString());
        new loadImageTask().execute( URL);// it calls another function..
        TextView title = (TextView)findViewById(R.id.titleID);
        title.setText("TEXT");
        TableRow tr = new TableRow(this);
        tr.addView(imgView);
        tr.addView(title);
        tl.addView(tr, new TableLayout.LayoutParams(LayoutParams.WRAP_CONTENT,     LayoutParams.WRAP_CONTENT));
    } catch(JSONException e) {
        //Log.e("log_tag", "Error parsing data " + e.toString());
    }

I am not sure why I’m receiving the error, but it appears to be being generated while I am adding it to the view.

  • 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-15T18:39:54+00:00Added an answer on June 15, 2026 at 6:39 pm

    Solution is that we either we define the rows in .xml file or in our .java file. I was adding the rows dynamically in my java file and using addView. So in .xml file we cannot add another view (we should not add rows for the same).

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

Sidebar

Related Questions

For some reason i keep getting the following error when i try to set
For some reason I keep getting a error that says toupper cannot be used
For some reason I keep getting error C3861: '__typeof': identifier not found when I
I have this header file ... for some reason I keep getting an error
I've been using valgrind, but for some reason I keep getting a memory error
For some reason, I keep getting the following errors in ErrorHandler.h why size function
I'm trying to use MapClassLoader in autoload.php but for some reason I keep getting
For some reason, I keep getting a '1' for the file names with this
For some reason, I keep getting XMLDoc is null, in firebug. I think that
To keep it simple, I've installed the SDK and for some reason cannot seem

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.