Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I go from one page to another without using Intent?

Tags:

android

I want to create an application based on quiz which consists of 14 questions.

Can anyone tell me how do I need to go from one question to another by clicking on next button.If I use an Intent then I am afraid that I will be creating 14 Activities :(

I don't think that is the programmatic procedure too.

like image 706
Vivek Kalkur Avatar asked Jul 22 '11 04:07

Vivek Kalkur


3 Answers

You can stay in the same Activity and keep track of the question.

You might want to use a TextSwitcher to add a fade in/fade out animation when swapping the question's text.

like image 166
Macarse Avatar answered Oct 29 '22 00:10

Macarse


You could have the button click just update the questions text to be the next question.

     nextButton.setOnClickListener(new View.OnClickListener() {
         public void onClick(View v) {
             questionTextView.setText(questionTwo);

         }
     });
like image 27
nicholas.hauschild Avatar answered Oct 29 '22 00:10

nicholas.hauschild


@Vivek you can use view flipper

this might help you

http://www.bogotobogo.com/Android/android9TabWidgetFlipper.html#SlidingDrawer

http://www.warriorpoint.com/blog/2009/05/29/android-switching-screens-by-dragging-over-the-touch-screen/

like image 2
Avi Dhiman Avatar answered Oct 29 '22 01:10

Avi Dhiman