I have create an android quiz application where i loaded all of question from web service. For this in oncreate method i wrote following
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.testlayoutforimage);
loadControls();
getPassingValue();
ParserMethod parserMethod=new ParserMethod();
//questionsObj=parserMethod.parseQuestionDetailsFor(passingFeature,numOfQuestion,passingSubject,passingChapter);
questionsObj=parserMethod.parseQuestionImages(passingSubject,passingFeature,passingChapter;
}
But problem is that when the question is loaded it take some time .
I want to add a progress bar. When the page is loaded then the progress is shown and the question is load . After that the bar is remove and Display the ques .how can i do this.
Using AsyncTask.. just like below.. code is not exactly right.. its just to give an idea..