My question is : How can I update my UI while I’m running thread which is downloading some data over internet. If I do something like this :
public void getCollectionsInfo(Context context){
jsonColl = new JsonCollection();
final Context acontext = context;
new Thread(new Runnable() {
public void run() {
jsonColl.executeInsert(acontext);
}}).start();
}
How can I refresh my activity where I’m showing the data which I receive via jsonColl.executeInsert(acontext);.
Any kind of help or suggestions are welcomed!
Thanks in advance!
Answer is as below.