I am working on an android app. I want to change Start activity dynamically. i mean when user start app first time then start activity will different and when start second time start activity change.This will skip first two activity and move to third activity .how can i achieve this.
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
No matter what first open your app in a Main Activity. Meanwhile use SharedPreference to save the data on how many times you have loaded the app.
You gonna have to do something as below in your
you Can Use SharedPreference according to your Requirement.
you can Store and Retrieve Values from this Link
Inside each
Oncreate()
method of your Activity you can Check for the SharedPreference Value and start your Activity there.Hope it will Help you.
You cannot change the first activity dynamically, but you can create a transparent activity like this:
and select next activity in the
onCreate
method:This is what I do when a user has selected a Remember Me check box on the Login Screen.
To save value to the
SharedPreference
file:You will need to do something like this once in the first
Activity
and once in the secondActivity
To retrieve the value from the
SharedPreference
file:And these are the necessary Global variables / instances used in the
Activity
:You will have to modify the code slightly to account for skipping 2
Activities
.Let me know if you need any help.
Use preferences to store the values(Conditions ) which you want to have . then according to that change the startActivity.
Use sharedpreference to first time they logged or not
Check the value
IN firstActivity