How do you pass context from one activity to another?

Thảo Justin

New member
How do you pass context from one activity to another?
Answer
You can create a method like setContext(Context context) in your DataBase Helper class to pass your context from your activity. You can get the context if you do getApplicationContext(); from your activity and pass that to your DBHelper class.
 

Tìm kiếm

Back
Top