Android中数据库的动态列表视图

时间:2011-07-29 04:30:29

标签: java android sqlite android-layout android-emulator

我正在开发一个Android应用程序,其中我必须呈现用户列表视图,其动态变化如下

  1. 当用户第一次打开时,必须单击“创建新”,然后点击它,这将导致新表单。创建后,它将保存在SQLite DB(固定1)中。例如。
  2. 2.当用户创建并再次打开应用时,必须显示   1.Potary 1重新订购   2.创造新的

    请提出宝贵意见

    此致 ChinniKrishna Kothapalli

1 个答案:

答案 0 :(得分:1)

首先看看如何生成列表视图。然后您可以看到如何使用SQLite数据库,以便您可以从数据库中插入和检索。一旦您能够执行这些操作,您就可以继续执行任务。步骤是

Retrieve value from the databse

Populate the UI which has a list populated from the retrieval values and a button with text
  create and an EditText.

In onClick method of button retrieve the text from EditText and save it to the Database and
  refresh the list(adding the newly created one to the list).