Save data in a SQLite database with the original format and view those data again with that form format

This is not an answer as I’m not going to give you the prewritten code for a copy/paste.
You should figure it out on your own but I’ll give you an overview of what you have to do.

  1. Search how to create SQL database and learn it through youtube tutorials. Some videos.
  2. Learn SQL (some basics) to understand what are columns and rows and
    how to use them for storing data. See here.
  3. This way you’ll learn how to store database and retrieve some data from it.

  4. After learning(some basics, just 1-2 days), you’ll know how to insert data into listviews using adapters and in textviews.

Just an example – suppose you’ve populated the listview using your SQL database and you click on a list item named “Kash”, then you can transition to a new activity which will have the same layout of current activity( the layout you’ve posted here, just change every edittext to textview) and set text to every textview by using this example –

  • you should execute this raw query for every textview.
    suppose you want to take the name from the database where invoice name = “kash” then "select Name from table_name where invoice_name = "Kash";". Save the selected text to a string(ex -namestring) value or cursor and show this in textview of name as textviewName.setText(namestring);
  • Or you can use the same query for every textview as
    create an if condition where every condition compares to a textview and set a separate columnName for every separate textview.
    then the query can be "select "+ columnName +" from tableName where invoice_name = "+ listitemClicked;" and set this retrieved value to every respective textview.

This way you’ll have what you need. But as No-one on StackOverflow wants to serve you the code for no efforts or less efforts at all.

Remember, what you want is not a hard thing but you should do it on your own.

This information is more than enough to proceed.
I could’ve downvoted you and left but downvoting isn’t the solution.

Browse More Popular Posts

Leave a Comment