Activity.java
SQLiteDatabase db;
String[] columns = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t"};
DetailAdapter adapter;
RecyclerView re;
List<AllList> list = new ArrayList<>();
DBHelper helper = new DBHelper(this,"dbName",null,1);
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate( savedInstanceState );
setContentView( R.layout.activity_detail );
re= findViewById( R.id.recyclerView );
re.setLayoutManager(new LinearLayoutManager(this));
adapter=new Adapter(this,list);
db = helper.getWritableDatabase();
Cursor c= db.rawQuery( "SELECT * FROM dbName ORDER BY b DESC" ,null);
while (c.moveToNext())
{
String a= c.getString( c.getColumnIndex( "a" ) ) ;
String b= c.getString( c.getColumnIndex( "b" ) );
String c= c.getString( c.getColumnIndex( "c" ) );
String d= c.getString( c.getColumnIndex( "d" ) );
String e= c.getString( c.getColumnIndex( "e" ) );
String f= c.getString( c.getColumnIndex( "f" ) );
String g= c.getString( c.getColumnIndex( "g" ) );
String h= c.getString( c.getColumnIndex( "h" ) );
String i= c.getString( c.getColumnIndex( "i" ) );
String j= c.getString( c.getColumnIndex( "j" ) ) ;
String k= c.getString( c.getColumnIndex( "k" ) );
String l= c.getString( c.getColumnIndex( "l" ) );
String m= c.getString( c.getColumnIndex( "m" ) );
int n= c.getInt( c.getColumnIndex( "n" ) );
int o= c.getInt( c.getColumnIndex( "o" ) );
int p= c.getInt( c.getColumnIndex( "p" ) );
int q= c.getInt( c.getColumnIndex( "q" ) );
int r= c.getInt( c.getColumnIndex( "r" ) );
int s= c.getInt( c.getColumnIndex( "s" ) );
int t= c.getInt( c.getColumnIndex( "t" ) );
AllList p=new AllList(a,b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t);
list.add(p);
}
if(!(list.size()<1))
{
re.setAdapter(adapter);
}
helper.close();