Update data in SQLite



"Update data in SQLite" 

   In previous blog we have studied about CREATE,INSERT,SELECT,DELETE operation on SQLite. We missed up about UPDATE operation. Today we are going to learn how to update data in SQLite table.

  If you understand how to insert data in SQLite, then it is very easy to learn UPDATE. Lets see following code snippet, here i have created two methods one for update mobile number and one for update email. The update() method is used for performing update operation. It contains Table name, content values and where clause. Just copy and paste this method in previous project's SQLiteHelper.java file.
  



 Now create design for showing edit option. See following code: Just replace two textview of number and email in single_view_name.xml file as shown in following block of code.
 

Add click listener for drawable right of textview using touch listener as shown in following code block. Add this two listener in your adapter class.(RecyclerDataAdapter.java).


Now create one activity for update data form showing. Here i have created UpdateActivity.java. 


Now create xml file for creating form design.



Now run your app and see the result.

Happy coding!!!

Click Here To Download Full Code

Comments

Popular posts from this blog

SQLite with RecyclerView

Swipe to delete RecyclerView Item