Your question can be answered with a simple context analysis:
It makes sense for you to change the user context (change Activity
) just to change the question? If you think it makes sense, then the answer is yes, you will need to create a Activity
for each question.
But in my opinion, it makes no sense to change the user’s context just for that. You can both use Fragments
, or update it Activity
, making an animation for the next question for example.
If your application has all questions embedded in the project (offline), you can, for example, create an Object Array and, with each question answered, update the screen with the next question by storing the user’s answer in a separate Array.
If on the other hand your application has the questions online (coming from a webservice/API), to each answered question you ask the next question to the server and stores the user’s answer, also in an Array.
Your question has many other questions.. But, roughly speaking, you can only have 1 Questions Activity and reload the information on the screen.You can use a counter to know which question to load (if they are always in the same order). About not knowing how many questions will be, you can have a new specific activity to be made this registration.
– emanuelsn