我想让我的可扩展列表平滑。
在互联网上查看了很多之后,我添加了一个 viewHolder 并更改了我异步加载数据的方法。但我的清单还是很慢!!!。
你能看一下吗?我添加了使用 DataProvider 异步加载数据的活动,然后初始化我的适配器。这有助于我查看我的活动和微调器,直到加载数据然后在我的视图中更新。但是当我滚动或尝试扩展类别时,我没有流畅的列表。你能帮我告诉我要改变什么吗?我认为它可以是图像,但我将它们保存在本地以使其更快(我添加了我的方法),它可以是其他东西......
我的活动:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Set layout for this activity
setContentView(R.layout.expandable_list);
// Set actionbar title
getActionBar().show();
getActionBar().setTitle(Html.fromHtml("<font color='#fffffff'>Groups</font>"));
if (loggedUserId != null)
Log.d("TAG", "My Groups for user ID: " + loggedUserId);
// Connect between buttons to layout id
expandableListView = (ExpandableListView) findViewById(R.id.exp_list);
spinner = (ProgressBar) findViewById(R.id.spinner);
createCategoryButton = (ImageButton) findViewById(R.id.createCategory);
textLoading = (TextView) findViewById(R.id.textLoading);
// Loading data to expandable group list asynchronously
AsyncTask<String, String, HashMap<String, List<Group>>> task = new AsyncTask<String, …Run Code Online (Sandbox Code Playgroud) performance android expandablelistview expandablelistadapter android-studio