Keep the account info in all activities in android studio

前端 未结 2 1587
庸人自扰
庸人自扰 2021-01-24 09:20

My application is simply a managing database application. I have a remote mysql server set up and my android studio application uses http post request to connect to that server.

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-24 09:42

    Many options:

    1) Create a global class with static variables.

    2) Extend the Application class and store information in it.

    2) If it's just two-three parameters, you can store it in shared preferences.

提交回复
热议问题