I’m trying to get Application Context inside my plugin but it throws this error:
Can’t create handler inside thread that has not called
Looper.prepare()
Here is my code:
ResourceManager manager = ResourceManager.getInstance(this, this.ctx.getApplicationContext());
I even changed my code to :
ResourceManager manager = ResourceManager.getInstance(this, this.cordova.getContext());
and
ResourceManager manager = ResourceManager.getInstance(this, this.cordova.getActivity());
also tried:
ResourceManager manager = ResourceManager.getInstance(this, cordova.getActivity().getApplicationContext());
but it still throws the same error message
FIXED: The issue was not related to getting applicationContext, there was a problem in the ResourceManager