开发者

Android pattern for activity "flows"

开发者 https://www.devze.com 2023-02-01 18:56 出处:网络
I\'m developing an android app that has a bunch of screens (activities) that are supposed to have \"continue\" and \"back\" buttons at the top.Can you tell me the right pattern for implementing this?I

I'm developing an android app that has a bunch of screens (activities) that are supposed to have "continue" and "back" buttons at the top. Can you tell me the right pattern for implementing this? I've seen开发者_JAVA技巧 some iPhone apps that have this but Android apps usually don't (I think partly because the back button is part of the phone).

I found a post online about an Activity class that has "sub activities" which kind of seems like what I want to do, but I'm wondering if there's a simpler solution or pattern for creating flows like this (in which several activities are linked with continue/back buttons).


You answered part of it yourself. There shouldn't generally be a software back button because android has a hardware back button. As for a continue button, that's extremely context dependant so it would probably be written in software based on the context.

No that doesn't sound like what you want. You're probably thinking of an activity group and from the very vague description of your design, you don't want those. There's no "simpler" solution or pattern to create flows like this because this is the exact default android behaviour.

Just start a new activity in your "continue" button, and the back button will finish that activity.


I'm developing an android app that has a bunch of screens (activities) that are supposed to have "continue" and "back" buttons at the top.

If you want to implement a wizard, use buttons at the bottom and do it as a single activity, perhaps using a ViewFlipper for the changing contents.

If this is not logically a wizard, just allow the BACK button to handle "back", and tapping on something meaningful to go forward, as a set of regular activities, like a regular Android application would.

In other words, please follow platform navigation conventions.


can you just open a new activity as per usual android development and make the back button call finish() you can set your theme to make the activity animate out like the iphone when finish is called.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号