How to check duplicates name in android database?

后端 未结 2 355
一整个雨季
一整个雨季 2021-01-25 08:20

I want to enter name and phone number from two edit text.i use two buttons to save and show it in emulator using list view.After entering name and when i click save button

2条回答
  •  走了就别回头了
    2021-01-25 08:28

    Put UNIQUE in your table field definition an then use insertOrThrow. If you insert the same, insertOrThrow will cause an exception, you can intercept it.

提交回复
热议问题