ferguior
ferguior

Reputation: 271

Best approach regarding Activity's flow

I have an Activity where there's a form to be fulfilled by the user. It has some textfields and so on.

The user also needs to introduce the GeoLocation of the item. For that purpose I created another activity where the user will press and the app will take the coordinates of it.

Knowing this, which would be the best approach?

  1. The form activity has a button that calls the map activity and expects a result with the coortdinates. Will the values introduced in the form be there after coming back from the map activity?
  2. The form activity launches the map activity when the user has filled the form and clicked on next. The map activity receives all the date from the previous form and will be in charge or forwarding it to the server.

Which one is more reliable? And more efficient? Faster? Better structured? Do these options have any drawbacks? Is there any other approach that I didn't consider?

Upvotes: 0

Views: 70

Answers (1)

gianpi
gianpi

Reputation: 3210

I think the first option is a better flow for the user, because it's clearer when she wants to submit the form compared to option two where the 'next' step (and then submit) could be a bit confusing.

With option one you will be in charge of filling the form with the coordinates, but it's a very simple task with startActivityForResult: when the map activity returns the coordinates, onActivityResult will be called in your form activity, and from the intent (third parameter) you can retrieve the coordinates and show them in the form.

Upvotes: 1

Related Questions