kgnzpk kgnzpk - 10 months ago 360
Java Question

Android get context from non Activity Class

I m creating an open source library for android in this library I should call a method on application start. After this method call I need to get context. Is there a way to get current context or activity from a static class without pass Context parameter to method. Is android send an intent when an activity start.


Pass an Instance of Context via Constructor

class YourClass {
    private Context context;

    public YourClass(Context context) {