I have an activity where I have a few main buttons which should be displayed all the time, and I have for every main button a few sub-buttons. The sub-buttons shall be displayed when I click on one main-button.
enter image description here
They are like titles: There are main titles and every main title has got a few sub titles. But the sub-titles should only be displayed when I click on the button with the main title. So when I dont click, only the main buttons shall be seen, not the subbuttons.
How do I realize that? Or is there a godd tutorial for that?
Inside of an View.OnClickListener(), use the following code to make a button invisible:
b.setVisibility(View.GONE);
And to show it:
b.setVisibility(View.VISIBLE);
Related
I have a layout that contains 5 buttons which must display one particular dialogbox on clicking any of the buttons.
I assigned one id to the buttons and set an onClick listener to it.
surprisingly, only the first button on the layout displays the dialogbox and others do not.
how can i make all of them to display that particular dialog because i don't want to create different dialog for each button.
Please use a class to assign the attribute. Multiple buttons cannot have the same id.
Hi friends, I am working on Codename one project, which is the demo app based on PSD to APP example below is the splash screen of my application
! [enter image description here] 2
But whenever I am clicking on the get started button it goes expand like below screenshot and text also move center to left side
Can anyone help me regarding this.....
You need to style the Selected and Pressed states of your button UIID in the GUI Builder.
If the Get Started button has Button UIID, then style both Pressed and Selected state of Button UIID in GUI Builder. See image below:
You could just copy and paste the UIID on both Selected and Pressed sections.
I have a MainActivity where I am showing a button at the bottom of the screen and there some other buttons in the middle of the screen.
At this point of time the bottom button is not doing any thing.
Clicking on any other buttons opens another activity - DisplayActivity.
My issue is that when I am coming back to MainActivity from DisplayActivity, the bottom button is not getting displayed.
I have to kill the app and launch it again in order to see it.
Please let me know if you are aware of this issue and have any solution.
Many Thanks.
I'd say you don't instantiate your layout XML in your onCreate method, but somewhere else
I got 2 Fragments. In the first Fragment I got a button.
How is it possible to duplicate the button on the second Fragment when the user click on it.
What do you mean by duplicating a Button? If it means creating a Button with the same text or other layout attribute, you can create a method in the second Fragment, like createButton(String text, int color), to add the button dynamically. When the button is clicked, find the second Fragment, cast it to the class of second Fragment and call the createButton method.
I am developing one app.In that app I had created one main screen.On that main screen i had added one button field .When i clicked on that button field to open my popup screen it will open my popup screen but it also show menu items whatever i added for my main screen in front of screen.However i don't want to show those menu items but only want to open my popup screen on click of that button.Please help me.
Add ButtonField.CONSUME_CLICK style on your ButtonField, like below.
ButtonField btn = new ButtonField("My Button", ButtonField.CONSUME_CLICK);