我有我需要加载的缩略图的要求和Text
在ListView
其被通过自定义设置Adapter
.缩略图应存放在缓存中,供我使用的通用图像装载机不过我在它的实现非常困惑,以及如何在使用它按我的要求来加载图像ListView
从URL
.请通过良好的实施建议我一些方法.
我有一个方法,initializeViews
它在最后一行遇到ArrayAdapter constructor undefined
错误.
该方法位于F1Fragment
,延伸MainFragment
.MainFragment
然后附加到Activity
.
我们不能给的上下文Fragment
中的ArrayAdapter<string>
构造?我是Android新手.请指正.提前致谢.
private void initializeViews(RelativeLayout contentLayout) {
leaguesListView = ( ListView ) contentLayout.findViewById ( R.id.leaguesListView );
progressLinear = (LinearLayout) contentLayout.findViewById ( R.id.progressLeagues );
values= new String[] { "RedBullRacing", "McLaren", "Lotus",
"ForceIndia", "HRT", "Ferrari" };
adapter= new ArrayAdapter<String>(F1Fragment.this, android.R.layout.simple_list_item_1, android.R.id.text1, values);
}
Run Code Online (Sandbox Code Playgroud)