【发布时间】:2012-02-27 13:05:44
【问题描述】:
我正在开发一个 Android 项目,但遇到了问题。 我有一个活动,其中包括三个按钮、编辑文本和一个列表视图。
我想更改该实现并仅在用户按下全选按钮时在新的弹出窗口上显示列表视图。 我已经添加了我的代码,谢谢。
public class Notepadv1 extends ListActivity implements OnClickListener {
private WordsDbAdapter mDbHelper;
private Button selectAllButton;
private PopupWindow mPopup;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
selectAllButton = (Button)findViewById(R.id.selectAll);
selectAllButton.setOnClickListener(this);
mDbHelper = new WordsDbAdapter(this);
mDbHelper.open();
fillData();
}
public void onClick(View v) {
switch(v.getId()){
case(R.id.selectAll):
selectAll();
break;
}
}
private void selectAll(){
}
private void fillData() {
Cursor c = mDbHelper.fetchAllNotes();
startManagingCursor(c);
String[] from = new String[] { WordsDbAdapter.KEY_WORD };
int[] to = new int[] { R.id.text1 };
SimpleCursorAdapter notes = new SimpleCursorAdapter(this, R.layout.words_row, c, from, to);
setListAdapter(notes);
}
}
【问题讨论】:
标签: android listview popupwindow