NullPointerException happens in an Android code snippet

前端 未结 2 1979
执笔经年
执笔经年 2021-01-15 05:25

Here\'s the code which deals with member registration.

public class RegisterActivity extends Activity {
    private static final String TAG = RegisterActivit         


        
2条回答
  •  南笙
    南笙 (楼主)
    2021-01-15 06:10

    the problem is you didn't declare your Subclass of Application to the AndroidManifest. Add android:name="path.to.AppController" to the Application tag, otherwise your subclass of Application is not instantiated and mInstance remains not initialized (null by default). And that explains the NPE

     
    

提交回复
热议问题