javaは多重継承をサポートしていないので、これを動作させるには問題があります。ListActivityとAsyncTaskの両方を拡張できません
これは私が何をしたいです:
public class CallForwardActivity extends ListActivity /* This is there I want to extend AsyncTask */ implements OnSharedPreferenceChangeListener
{
... // creating and initializing stuff
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
userInfo = this.getSharedPreferences(USERINFO_FILE, 0);
userInfo.registerOnSharedPreferenceChangeListener(this);
userControl = new UserController(context);
ListView lv = getListView();
lv.setTextFilterEnabled(true);
//setListAdapter(new ArrayAdapter<String>(this, R.layout.callforward_items, R.id.callforward_item_text, callforwardLabels));
list = new ArrayList<HashMap<String,String>>();
callForwardList = new SimpleAdapter(
this,
list,
R.layout.callforward_items,
new String[] { "line1","line2" },
new int[] { R.id.callforward_item_text, R.id.callforward_number });
populateList();
setListAdapter(callForwardList);
lv.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view, int position, long id)
{
CustomDialog(); // this will make the asynchronous task call if the user presses "OK" within the dialog box.
}
});
}
は、どのように私はAsyncTaskを延長せずにコールを非同期になって行くのですか?