The app is a University APP, My application contains two buttons in mainactivity(calicutuniversity and mguniversity ), if we click on a button then it goes to the corresponding activity and saves that activity as the default for further application usage. Now i need to try some more ideas into my application. I think you guys can help me for that. I need to.....
相关问题
- Delete Messages from a Topic in Apache Kafka
- Is there a limit to how many levels you can nest i
- Jackson Deserialization not calling deserialize on
- How can I create this custom Bottom Navigation on
- How to maintain order of key-value in DataFrame sa
When the user is opening the app for the first time check the value of the Shared Preferences and it should take the default value if it does then open the MainActivity.
Else go to that particular activity.
And whenever the user chooses something from the MainActivity then just edit the contents of the Shared Preferences.
Add an Activity before your MainActivty.java that will check the SharedPreferences to load to the activity you want. I added an activity called ReallyEmptyActivity
here's the ReallyEmptyActivity.java
This will act as your director to the specific activity as upon the user. Your mainactivity.java will be the main screen where the user selects the university.
when the user clicks the back button it'll take him back to the MainActivty where they can select the University again and when the app is re-run, the corresponding activity will be shown as the SharedPreference is getting overwritten.