如何在Android可扩展列表视图中获取多个复选框值?
I'm not 100% sure, as I've yet to do this myself, but I would try making your ListView item, (the layout you use as what is in each list item) a drawer, and go from there, I would assume you'd like to populate them depending on if you need them or not, so I would using something along the lines of
final Button btnLogin = new Button(this);
btnLogin.setText("Login");
btnLogin.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
btnLogin.setGravity(Gravity.CENTER);
btnLogin.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
new GetDataFromServlet().execute(NetworkActivity.this);
Log.i(getClass().getSimpleName(), "button was pressed");
}
});
But as a checkbox, not a button
这是一个在ExpandableListView中实现复选框的示例程序: mylifewithandroid.blogspot.com:可扩展列表和复选框
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.