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

  • Home
  • SEARCH
  • 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 8843359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:12:02+00:00 2026-06-14T11:12:02+00:00

I have a code that just don’t work! The AsyncTask needs to return a

  • 0

I have a code that just don’t work!
The AsyncTask needs to return a TreeMap < Integer, List< String > > but through my logging i see it doesn’t. It just stucks!

Here is the code:

private class ParseSite extends
        AsyncTask<String, Void, Map<Integer,List<String>>> {
    Map<Integer,List<String>> quotes;
    List<String> tmpInfo;
    List<String> tmpText;

    @Override
    protected Map<Integer,List<String>> doInBackground(String... arg) {
        // List<String> output = new ArrayList<String>();

        quotes = new TreeMap<Integer,List<String>>();

        try {
            HTMLHelper hh = new HTMLHelper(new URL(arg[0]));
            List<TagNode> qText = hh.getContentByClass("content");
            Logger.l(Logger.TAG_DBG, "GOT qText");
            List<TagNode> qInfo = hh.getContentByClass("sm");
            Logger.l(Logger.TAG_DBG, "GOT qInfo");
            tmpInfo = new ArrayList<String>();
            tmpText = new ArrayList<String>();

            for (Iterator<TagNode> iterator = qText.iterator(); iterator
                    .hasNext();) {
                TagNode divElement = iterator.next();
                String tmp = divElement.getText().toString();
                tmp = tmp.replaceAll("&lt;", "<");
                tmp = tmp.replaceAll("&gt;", ">");
                tmp = tmp.replaceAll("&quot;", "" + (char) 34);

                tmpText.add(tmp);
                Log.i(Logger.TAG_INF, tmp);
            }
            Logger.l(Logger.TAG_DBG, "tmpText[" + tmpText.size() + "] Filled");
            quotes.put(1, tmpText);
            for (Iterator<TagNode> iterator = qInfo.iterator(); iterator
                    .hasNext();) {
                TagNode divElement = iterator.next();
                String tmp = divElement.getText().toString();

                tmpInfo.add(tmp);
                Log.i(Logger.TAG_INF, tmp);
            }
            Logger.l(Logger.TAG_DBG, "tmpInfo[" + tmpInfo.size() + "] Filled ");
            quotes.put(2, tmpInfo);
            Logger.l(Logger.TAG_DBG, "quotes Filled");
        } catch (Exception e) {
            e.printStackTrace();
        }
        Logger.l(Logger.TAG_DBG, "Returning quotes...");
        return quotes;
    }

    @SuppressWarnings("unused")
    protected void onPostExecute(List<String> output) {
          pd.dismiss();
          Logger.l(Logger.TAG_DBG, "Setting adapter...");
          listView.setAdapter(new QuotesArrayAdapter(HTMLParser.this,
              quotes));
        }
}

Through LogCat i can see my “Returning quotes…” but i can’t see “Setting adapter…” and the ProgressDialog pd does not dismiss.

BTW sorry for my bad english. I’m russian.

  • 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-14T11:12:04+00:00Added an answer on June 14, 2026 at 11:12 am

    The compiler is warning you, but you choose to ignore it:

    @SuppressWarnings("unused")
    

    The compiler knows this method is never used, because you’ve declared it wrong. Change it to:

    @Override
    protected void onPostExecute(Map<Integer,List<String>> output) {
          pd.dismiss();
          Logger.l(Logger.TAG_DBG, "Setting adapter...");
          listView.setAdapter(new QuotesArrayAdapter(HTMLParser.this,
              quotes));
    }
    

    Notice the type of the parameter, and the @Override annotation. Using this annotation will ensure you overrode methods correctly by giving an error if you didn’t.

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

Sidebar

Related Questions

I have a dynamic list code that works just fine. My only problem now
I'm using Code First with EF 5. Currently I have SPs that return just
My code isn't really that relevant but just to give you background, I have
I have this test code that just saves an XML file to a folder.
I have this code that asks for a username and password. Just a simple
I have some code I am working on that worked just fine until I
I have this mySQL code that connects to my server. It connects just fine:
I'm just learning about python. I'm fairly new. I have the following code that
this is just a couple of lines of code that i have in my
I have just written a small piece of code and it struck me that

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.