Hey, Thanks for the codes but can anyone tell me how to modify it for the use of in this context , i realise the other is made for a button or something else??
- Code: Select all
public class ASYNC extends ListActivity {
public String hello = "";
public boolean source = false;
final Context ab = this;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Bundle extras = getIntent().getExtras();
hello = extras.getString("selection");
source = extras.getBoolean("Searchbox");
DoInBackground.execute();
}
private class DoInBackground extends AsyncTask<Void, Void, Void> {
private ProgressDialog dialog;
protected void onPreExecute() {
dialog = ProgressDialog.show(makan_list_results.this, "",
"Busy...", true, true, (OnCancelListener) this);
}
protected Void doInBackground(Void... v) {
do_update();
return null;
}
protected void onPostExecute(Void v) {
dialog.dismiss();
}
}
public void do_update() {
try {
//my methods here
// GETTING XML N SETTING XML DATA IN TO LISTactivity
} catch (Exception e) {
// error msg
}
}
}
Currently the problem i face is that when i cannot compile as there is an error on the line ( DoInBackground.execute(); )
Cannot make a static reference to the non-static method execute(Void...) from the type AsyncTask<Void,Void,Void>
My other codes are working fine before the implementation of AsyncList.
Please advise
Teck Chai
Oh btw, Eclipse user here, 2.2 API level. Yogurt FTW