As u see from my screenshot, what i have here is my program thus far.
The first, 2nd and 3rd tabs retrieve data from web (xml) n is displayed as a list.
So If i change from tab1 to tab 2, it will checked the web for data.
I was planning to used ASYNCTASK here but apparently there was a error and I was unable to execute the line
- Code: Select all
aSynctask.execute();
error msg = Cannot make a static reference to the non-static method execute(Object...) from the type AsyncTask
Then i tried
- Code: Select all
new aSynctask.execute();
error msg = aSynctask.execute cannot be resolved to a type
I noticed that the tutorials for Asynctask is always used in the onClick of a button, but i put my code in the onCreate() of an activity. So i was wondering if that was any difference at all.
- Code: Select all
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bundle extras = getIntent().getExtras();
hello = extras.getString("selection");
source = extras.getBoolean("Searchbox");
new aSynctask.execute();
DoubleTextAdapter dta = do_update();
setListAdapter(dta);
ListView lv = getListView();
lv.setDivider(getResources().getDrawable(R.drawable.divider));
lv.setDividerHeight(2);
lv.setBackgroundColor(getResources().getColor(
R.color.AlmostBlack));
}
If anyone has some example of AsyncTask being used in onCreate() or any can provide any tips, i will be very grateful.
Please Advice,
Teck Chai




...
)
) with this. I think this marks the end of this topic. You might wanna change add [solved] to the title.
