Honestly, I am glad I got this to work the first time. Otherwise, I totally would have been stuck for who knows how long.

It probably had been more than 2 years since I used ListView and modified its contents like adding, removing and updating. When I made another go recently, I was confused why the ListView does not refresh its content.

I thought calling the notifyDataSetChanged() of ArrayAdapter after add() or remove() will do the trick in the onPostExecute() of the AsyncTask class.

The solution is not to use the add() or remove() method of the ArrayAdapter class. Instead, you place a global variable in your class for the ArrayList object that you will pass to the ArrayAdapter.

I instantiate an ArrayAdapter like this:

Make sure the myArrayList variable is global. So that within your AsyncTask class, you can call add() or remove() method of the ArrayAdapter class within doInBackground() of AsyncTask and call adapter.notifyDataSetChanged() onPostExecute().

That should refresh your ListView contents.

See sample below:

Developing a great presentation is a skill that not everyone has. If you struggle to create something that your boss or others who you present to will see as credible and professional, it may be a good idea to outsource the creation of your presentation to Powerpoint specialists who can help you make something that is more becoming of your status as a professional.

A specialist can help create stunning visuals that will wow those who view your slides. With the right colors and graphics, you can keep your audience engaged and interested throughout your entire speech regardless of how long it is.

When you are able to connect with your audience, it makes it easier to sell your products and services to those who you are pitching to. If you are trying to convince a busy client to invest in your company, having a presentation that gets to the point and brings out the key information clearly and quickly increases your odds of winning that investment money.

You only have one chance to make a good first impression on somebody. By having a professionally crafted Powerpoint presentation, you come off as knowledgeable and something worthy of respect when you talk.

Related Posts Plugin for WordPress, Blogger...