• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Beginner Development Help...Activities vs Views

Hi there,

I'm making a simple quiz app. There will be a number
of questions and each question will be on it's own individual
screen with a 'yes' and 'no' button at the bottom.

At the moment, each question is a new activity but, I have only added
10 questions so far and the app size is already up to 3.5 MB.

What is the best way I can have a new screen for each question
while keeping the app size to a minimum? One activity with different views
maybe? But that creates new problems whereby pressing the 'back' button
goes right back to the app menu.

Thanks for any advice you can give.
 
For something like this, I think you just want the one activity, with a single question view. Each time the user answers a question, update the question view with a new question. If you want the BACK button to go to previous questions, then simply override the Activity.onBackPressed.

Good luck!
 
Hi there,

I'm making a simple quiz app. There will be a number
of questions and each question will be on it's own individual
screen with a 'yes' and 'no' button at the bottom.

At the moment, each question is a new activity but, I have only added
10 questions so far and the app size is already up to 3.5 MB.

What is the best way I can have a new screen for each question
while keeping the app size to a minimum? One activity with different views
maybe? But that creates new problems whereby pressing the 'back' button
goes right back to the app menu.

Thanks for any advice you can give.

You can use fragments for a job like this.... you can add each question as a new fragment... with its own view... I've done something similar in my own app
Edit: didn't read the above answer... way better solution
 
Back
Top Bottom