如何让用户添加和删除项目到ListView? [英] How to let a user add and remove items to a ListView?
本文介绍了如何让用户添加和删除项目到ListView?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图让这个当用户点击一个按钮,它会弹出一个对话框
与的EditText
和确定的按钮
。当用户完成,对话框,它应该的添加的他们刚刚键入到的ListView项目
。我该怎么做呢?
I am trying to make it so that when a user clicks a button, it pops up a dialog
with an EditText
and an OK Button
. When the user completes, the dialog, it should add the item they just typed in to the ListView
. How do I do this?
我需要一个大code例子;这是我的第一个应用程序。
I will need a large code example; this is my first application.
推荐答案
您将要遵循官方记事本教程的例子。这是非常COM prehensive。它做你想要做的95%。
You'll want to follow the official notepad tutorial example. It's very comprehensive. It does 95% of what you want to do.
http://developer.android.com/resources/tutorials/notepad/ index.html的
这篇关于如何让用户添加和删除项目到ListView?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文