jeudi 20 août 2015

send data from one activity to another from SQLite database

I want to retrieve all the records from table and show it in another activity,but when I do I am getting one record at a time and in reverse order.I want all the records in single activity

@Override
    public void onClick(View v) {
        Intent i = new Intent(MainActivity.this, ViewAllActivity.class);//

        while (c.moveToNext()) {

            i.putExtra("rollno", c.getString(0));
            i.putExtra("name", c.getString(1));
            i.putExtra("marks", c.getString(2));
            startActivity(i);
        }

    }
});

Aucun commentaire:

Enregistrer un commentaire