Как отправить данные из трех фрагментов обратно в активность хоста, а затем отправить их в базу данных как один?
Hi im making a password manager in android studio and storing all the data using firebase. The issue im stuck on is creating the registration form. If i simply had one activity with all information on one page i would be able to set this up. However ive got too much infomation to have it on one page so it would look messy. Instead ive created a single activity and have three fragments. After each page the user will click continue until the final page where the user will sign up and all of the data from each fragment is sent to the database as one. fragment 1 is responsible for user info e.g. name, email, phone number. fragment 2 is responsible for master password and fragment 3 is responsible for shared secret. Thanks for any help / ideas.
Что я уже пробовал:
having not used fragments im abit lost with the whole process i know you can use interfaces or viewmodels to send data back to the activiy. But what would be the best approach be? ive initialy set up interfaces on each fragment but im unsure how to call these in the activity and then create a method which takes the information from each interface put it into one then send it the database.
David Crow
Большинство данных могут быть отправлены через Intent
Вы также можете использовать настройки. Вы пробовали что-нибудь из этого?