How to use same layout for different actions in android? -


i designing app contains around 25 questions.

how keep changing questions when click next button. here layout remains same except question (i.e. textview may change according different questions other elements buttons, background not change).so creating many layout different questions time consuming.

so how can use same layout these many questions.should create these many layouts , classes asking each question??

you should store questions in database, or in static final string[] if there aren't many of them.

multiple classes not required here, because change question text, i.e. questionview.settext(newquestion);.

then need 2 buttons - yes , no, have onclicklistener set them, in return sets questionview's text newquestion.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -