NullPointer on LayoutInflater - Android
问题 I have a class in another java file that I'm calling in my MainActivity. I need to inflate some layouts in the external class. The problem I'm having is specifying the context, because when I try to inflate the layouts I get a Null Pointer Exception. The class doesn't have it's own onCreate() method so I need to pass the context from my MainActivity? Not sure how to go about it. This is causing me the NullPointerException : Context context = getApplicationContext(); LayoutInflater inflater =