[Solved] How to pass a variable from an activity to a class?


You can just instantiate your database class in your activity

OpenHelper mOpenHelper = new OpenHelper(this);

And create a method in your db class to create your tables

public void createTable(String nomelistafinal ) {
    final SQLiteDatabase db = getWritableDatabase();
    db.execSQL("CREATE TABLE " + nomelistafinal + " (codigo text not null) ");
    db.close();
}

0

solved How to pass a variable from an activity to a class?