Sqlite Database context android

Bhavin Thakar

New member
Oct 15, 2019
2
0
0
I have created a Database class file to use SQLite db in Android app. Since I am beginner and I am having problem understanding what should i put in context when I instantiate Database class to another class The database code is as follows:

public Database(@Nullable Context context) {
super(context,DATABASE_NAME,null,DATABASE_VERSION);
database=getWritableDatabase();
How can I instantiate it to an another class. When doing instantiation Database db = new Database(); what should be put under context
Database db =new Database(Combiner.this);. I tried this but its showing Database(android.content,Context) in Database cannot be applied to (com.example.data.Combiner)
 
Last edited by a moderator:
Hi, welcome to Android Forums

I'd like to recommend creating a account so me or other members can assist you, as guest have limitations in replying here and if we need further Information to communicate with you.

I'll provide a link to register, please come back to your post so we can further assist
https://forums.androidcentral.com/showthread.php?t=409154
 
I went ahead and moved this to the Software Development forum for more specific traffic.
 
Hi, welcome to Android Forums

I'd like to recommend creating a account so me or other members can assist you, as guest have limitations in replying here and if we need further Information to communicate with you.

I'll provide a link to register, please come back to your post so we can further assist
https://forums.androidcentral.com/showthread.php?t=409154

I have registered so how can i create the same thread and get assistance