I have two tabs. In these two tabs I have different activity groups. How to navigate from an activity in one activity group to another activity in android? Please help me with suitable examples.
相关问题
- 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
The best way of handling this is to use
Along with overriding your activity's
Whenever you're activity finishes, you will want to set the result to a certain code:
When the activity finishes, the previous activity's onActivityResult call will be invocated with the result code passed. Here, you can check for the result code and request code and then perform an action. In this case, you will want to do a cascading activity pop until you reach the first activity in the list. You can then set the result for this previous activity and finish it which will then trigger the next activity's onActivityResult. You can then do this until you reach the 'first' activity in your activity stack.
This method is also flexible because it lets you conditionally pop to certain points in your activity stack depending on how you handle the request code and result code.
in my case i did like this when i click on finish/submit button in last activity of parent group ,,i submitted values(storing values into server /database ) and i finished parent activity like getParent().finish();, and starting tabs activity and setting current tab like setCurrentTab(int)
it may not best approach but it may useful
sorry for my language
To programmatically switch between tabs use the
TabHost
methodsetCurrentTab(int index)
orsetCurrentTabByTag(String tag)
. The user can also click the tab UI (if used) to switch between them.