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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:42:11+00:00 2026-05-25T09:42:11+00:00

I try to fix it but the list data doesn’t show up..also, there is

  • 0

I try to fix it but the list data doesn’t show up..also, there is some red line in my code. onPostExecute it inform thatThe constructor SimpleAdapter(EventsActivity.syncEvent, ArrayList<HashMap<String,String>>, int, String[], int[]) is undefined.

Another thing, I would like to do is to show a progress when we refresh the even like when we refresh notification in facebook, we will see animation of refreshing the data, last date and time we did a refresh.How can i do that? Do you have any idea? I am quite new to implementation. Thanks for your advice.

public class EventsActivity extends ListActivity {

    EventDataSet sitesList = null;
    ArrayList<HashMap<String, String>> mylist = new ArrayList<HashMap<String, String>>();

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.listplaceholder);

    }

    private class syncEvent extends AsyncTask<String, Integer, String> {

        @Override
        protected String doInBackground(String... arg0) {
            try {
                /** Handling XML */
                SAXParserFactory spf = SAXParserFactory.newInstance();
                SAXParser sp = spf.newSAXParser();
                XMLReader xr = sp.getXMLReader();

                /** Send URL to parse XML Tags */
                URL sourceUrl = new URL(
                        "http://xxxx.heroku.com/xxxxxxxxxxx.xml");

                /** Create handler to handle XML Tags ( extends DefaultHandler ) */
                EventXMLHandler myXMLHandler = new EventXMLHandler();
                xr.setContentHandler(myXMLHandler);
                xr.parse(new InputSource(sourceUrl.openStream()));

            } catch (Exception e) {

            }

            /** Get result from MyXMLHandler SitlesList Object */
            sitesList = EventXMLHandler.sitesList;

            /** Set the result text in textview and add it to layout */
            for (int i = 0; i < sitesList.getName().size(); i++) {
                HashMap<String, String> map = new HashMap<String, String>();
                map.put("name", "Name: " + sitesList.getName().get(i));
                map.put("createat", "Create-At: " + Convertor.getDateTimeDDMMYY(sitesList.getCreateat().get(i)));

                mylist.add(map);
            }
            return null;
        }

        @Override
        protected void onPostExecute(String result) {

            ListAdapter adapter = new SimpleAdapter(this, mylist, R.layout.eventitem,
                    new String[]{"name", "createat"},
                    new int[]{R.id.item_title, R.id.item_subtitle});

            setListAdapter(adapter);
            //super.onPostExecute(result);
        }

        @Override
        protected void onProgressUpdate(Integer... values) {
            // TODO Auto-generated method stub
            super.onProgressUpdate(values);
        }
    }
}
  • 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-05-25T09:42:12+00:00Added an answer on May 25, 2026 at 9:42 am

    The problem is with the this reference. When you’re inside the AsyncTask, this refers to your AsyncTask subclass, and SimpleAdapter requires a Context as the first parameter. You should replace the call with an explicit reference to the parent class:

    new SimpleAdapter(EventsActivity.this, mylist , R.layout.eventitem, 
                    new String[] { "name", "createat" }, 
                    new int[] { R.id.item_title, R.id.item_subtitle });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Try the following code public enum Color { Blue=1, Red=2, Green=3 } public List<Color>
I can fix the below exception with a try-catch loop but I cannot understand
I try to do this directly to the interpret: (setf example (coerce blablabla 'list))
There're some library classes that although implement Serializable , fail to serialize correctly. I
I try to creat list for detail view. then put a search text box
I'm running into trouble with some Python stuff. I have a list that has
I have an image gallery. There is a list of thumbs. When you hover
I tried to search for my error, read some topics, but I couldn't find
I have a problem using JSF to display some data in Facelets. I have
The following algorithm has some bugs, i don't know how to fix it, i

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.