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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:40:58+00:00 2026-06-17T11:40:58+00:00

I am trying to call the view from another class in my Asynctask class

  • 0

I am trying to call the view from another class in my Asynctask class but it doesn’t seem to be working.

Here is my AsyncTack

private class parseSite extends AsyncTask<String, Void, List<Integer>> {

    protected List<Integer> doInBackground(String... arg) {
     List<Integer> output = new ArrayList<Integer>();
        try {
            htmlHelper hh = new htmlHelper(new URL(arg[0]));
            output = hh.htmlHelper(arg[0]);
        } catch (Exception e) {
            System.out.println("Error");
        }
        return output;
    }

    protected void onPostExecute(List<Integer> exe) {

        graph salesView = new graph();
        View chartView = salesView.getView(this);
        chartView.setLayoutParams(new LinearLayout.LayoutParams(
                LinearLayout.LayoutParams.FILL_PARENT,
                LinearLayout.LayoutParams.FILL_PARENT, 1f));
        LinearLayout layout = (LinearLayout) findViewById(R.id.linearview);

        layout.addView(chartView, 0);

    }
}

And here is what the activity ‘graph’ looks like

public class graph {

public View getView(Context context) (...etc.)

I don’t understand why it can’t call 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-17T11:40:59+00:00Added an answer on June 17, 2026 at 11:40 am

    Assuming you intended graph to extend Context in some way, such as by extending Activity, and that parseSite is defined inside graph, make the following change:

    View chartView = salesView.getView(graph.this);
    

    In the original code, this is referring to parseSite which does not extend Context (and does not refer to graph as you probably intend).

    As a side note, in typical Java style classes should be named with an upper case letter, i.e. Graph not graph.

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

Sidebar

Related Questions

I'm trying to call a method from another class with a simple button in
I'm trying to call a function present in one class from another class by
I'm trying to return a JSON response from a Django view call via an
I am trying to get the code found here: http://snipplr.com/view/26643/mbprogresshud-with-an-asynchronous-nsurlconnection-call/ to work in my
I am trying to pass an object from my main view class to other
I am trying to pass some values to another View from the Controller .
I am trying to re-call core-data in UITable using model view. I am in
Trying to call a SAP SOAP Web Service from a generated sudzc app shows
Im trying to call a method that will add or subtract 1 from a
I am having trouble parsing the response from my app. Here is the call

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.