2013-01-03 42 views
0

我需要一些帮助Asynctask和自定义适配器。 我有一个asynctask通过解析获取数据。然后我必须把它们放在ListView。 我创建了一个自定义适配器,但是我的上下文有问题。我相信这有一个非常简单的解决方案,但我不明白实际上背景是! 问题是Eclipse所示:上下文和自定义适配器

protected void onPostExecute(final List<String> list) { 
     ListView listView = (ListView)findViewById(R.id.listavvisi); 

     CustomAdapter adapter = new CustomAdapter(**this**, R.layout.rowcustom, list); 
     listView.setAdapter(adapter); 

,我通过我的列表customadapter

public class CustomAdapter extends ArrayAdapter<Avviso> { 
private Context context; 

    public CustomAdapter(**Context** **context**, int textViewResourceId, List<Avviso> Strings) { 
     super(context, textViewResourceId, Strings); 
} 

什么背景调用New Customadapter...当我需要?

回答

1

我回答我自己的问题。因此,我不得不使用“javaclass.this”而不是“context”