how to show a set ot data in listview to next activity?

In android, I used Sqllite to store a set of data in listview,I want to retrive a data into next activity
sowmya laksmiAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Chris HarteThaumaturgeCommented:
That is a big question. I take it you want to know how to write an app that will access an SQLite database on your device. Your best bet is to search for a tutorial such as this one
https://www.experts-exchange.com/courses/3/Android-App-Development.html?utm_source=experts-exchange&utm_medium=post&utm_campaign=course-of-the-month_0221&utm_content=0221

If you get stuck and have a specific question about code, then you can ask it here.
If you do have a query about listviews, make it less general and more code specific.
0
sowmya laksmiAuthor Commented:
package com.example.sowmyarasiga.lassierproject;

import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.BaseBundle;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.EditText;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.Spinner;
import android.widget.TextView;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import static com.example.sowmyarasiga.lassierproject.DatabaseHelper.TABLE_NAME;

public class ListviewActivity extends AppCompatActivity {
    ListView listView;
    SQLiteDatabase SQLiteDatabase;
    Cursor cursor;
    SQLiteListAdapter ListAdapter ;
    ArrayList<String> NAME = new ArrayList<String>();
    ArrayList<String> DEPARTMENT = new ArrayList<String>();
    ArrayList<String>  FROM= new ArrayList<String>();
    ArrayList<String> TO = new ArrayList<String>();
    ArrayList<String> FROMT = new ArrayList<String>();
    ArrayList<String>  TOT= new ArrayList<String>();
    ArrayList<String> REASON = new ArrayList<String>();
    ArrayList<String> ND = new ArrayList<String>();
    ArrayList<String> AT = new ArrayList<String>();
   ArrayList<String> ListViewClickItemArray = new ArrayList<String>();
    DatabaseHelper myDb;
    Intent intent;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_listview);
        myDb = new DatabaseHelper(this);
        listView = findViewById(R.id.list);





    }

    @Override
    protected void onResume() {

        ShowSQLiteDBdata() ;

        super.onResume();
    }

    private void ShowSQLiteDBdata() {
        SQLiteDatabase = myDb.getWritableDatabase();
        cursor = SQLiteDatabase.rawQuery("select * from " + myDb.TABLE_NAME + " order by NAME ASC", null);
        NAME.clear();
        DEPARTMENT.clear();
        FROM.clear();
        TO.clear();
        FROMT.clear();
        TOT.clear();
        REASON.clear();
        ND.clear();
        AT.clear();
        if (cursor.moveToFirst()) {
            do {
                NAME.add(cursor.getString(cursor.getColumnIndex(myDb.COL_1)));
                DEPARTMENT.add(cursor.getString(cursor.getColumnIndex(myDb.COL_2)));
                FROM.add(cursor.getString(cursor.getColumnIndex(myDb.COL_3)));
                TO.add(cursor.getString(cursor.getColumnIndex(myDb.COL_4)));
                FROMT.add(cursor.getString(cursor.getColumnIndex(myDb.COL_5)));
                TOT.add(cursor.getString(cursor.getColumnIndex(myDb.COL_6)));
                REASON.add(cursor.getString(cursor.getColumnIndex(myDb.COL_7)));
                ND.add(cursor.getString(cursor.getColumnIndex(myDb.COL_8)));
                AT.add(cursor.getString(cursor.getColumnIndex(myDb.COL_9)));
            } while (cursor.moveToNext());
        }
        ListAdapter = new SQLiteListAdapter(ListviewActivity.this,

                NAME,
                DEPARTMENT,
                FROM,
                TO,
                FROMT,
                TOT,
                REASON,
                ND,
                AT);

        listView.setAdapter(ListAdapter);
        listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {



                intent = new Intent(ListviewActivity.this,ListActivity.class);

                intent.putExtra("ListViewClickedItemValue", ListViewClickItemArray.get(position).toString());

                startActivity(intent);

            }
        });

        cursor.close();


    }

    }



This a code used for store a data in listview how i wiil retrive it
0
Chris HarteThaumaturgeCommented:
Here is a link to my github. It is a simple sqlite database that uses the recyclerview rather than listview, because that is the way google wants us to do it now.
https://github.com/Raging-Developer/Sticky_notes/tree/master/app/src/main/java/app/sticky_notes
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Chris HarteThaumaturgeCommented:
No further input from the OP
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Android

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.