首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > 其他 > The pretty way working with database on Android.

The pretty way working with database on Android.

  • 资源大小:37.83 kB
  • 上传时间:2021-06-30
  • 下载次数:0次
  • 浏览次数:1次
  • 资源积分:1积分
  • 标      签: android

资 源 简 介

How about some sample code? Your Activity ``` public class StartupActivity extends Activity { /** Called when the activity is first created. */ @SuppressWarnings("unchecked") @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); SandlerDatabase db = new SandlerDatabase(this, "tasks", 1, TaskList.class, Task.class); ArrayList userLists = db.findAll(TaskList.class); if (userLists.size() == 0) { // default tasklist TaskList taskList = new TaskList(); taskList.setName("Your task list"); Task task1 = new Task("Very first task"); Task task2 = new Task("Second sample task"); taskList.addTask( task1, task2 ); // store tasklist and its tasks in db db.setRecursion(Recursion.FULL); db.save(taskList); use

相 关 资 源

您 可 能 感 兴 趣 的

同 类 别 推 荐

VIP VIP