I am a beginner in android development. I am trying to develop an application & as a test run it is a Q&A app. I am facing an issue while creating pages, as the pages have 2 radio buttons in a radio group, the center of the page has an image, and have few buttons(Next, Previous, Home) at the bottom. I want a functionality that, whenever a user clicks on a radio button the image needs to disappear and the answer (Text) needs to appear in a scroll text box. The app is Yes/No based so when either button is clicked the image need to disappear and text needs to replace it. I searched few android developer forum communities look for a genuine solution, hoping a satisfactory solution form this platform. Thanks in Advance
Replacing images with text when a radio button is clicked |
1 Replies
For that workflow, I would place a Textview and a Imageview in the same layout, and set the textview visibility to Gone MyTextview.setVisibility(View.GONE);
When you want to switch the out the image for the text, just set the Imageview to Gone, and set the Textview to Visible.
MyTextview.setVisibility(View.VISIBLE);
MyImageview.setVisibility(View.GONE);