创建您的自定义适配器的实例,以便您可以在任何喜欢的地方使用它…
public class ScoreList extends SherlockFragmentActivity {private ListView listViewScore;private ScoreListAdapter adapter;static List<Score> listScore = new ArrayList<Score>();@Overridepublic void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.score_list); ctx = this; listScore = dbh.getAllScores(); listViewScore = (ListView) findViewById(R.id.score_list); adapter = new ScoreListAdapter(ctx, R.layout.score_row_item, listScore); listViewScore.setAdapter(adapter); adapter.notifyDatasetChanged(); }}顺便说一句,如果您的listScore数组已经加载,那么您不需要使用
adapter.notifyDatasetChanged();



