How to declare global variables in Android?

前端 未结 17 2991
死守一世寂寞
死守一世寂寞 2020-11-21 04:12

I am creating an application which requires login. I created the main and the login activity.

In the main activity onCreate method I added the following

17条回答
  •  花落未央
    2020-11-21 05:03

    DO N'T Use another tag in manifest file.Just do one change in existing tag , add this line android:name=".ApplicationName" where, ApplicationName will be name of your subclass(use to store global) that, you is about to create.

    so, finally your ONE AND ONLY tag in manifest file should look like this :-

    
    

提交回复
热议问题