android: how to use getApplication and getApplicationContext from non activity / service class

The getApplication() method is located in the Activity class, that’s why you can’t access it from your helper class.

If you really need to access your application context from your helper, you should hold a reference to the activity’s context and pass it on invocation to the helper.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)