Home>
I am currently creating a calendar app.
I am trying to process the button that appears when I tap the date,
The button is out before tapping the date.
How can I do this?
I tried with a conditional branch, but the result was not what I expected.
The position of the button is appropriate. At the moment, I'm devoted to tapping the date to show the button.
It is part of the current code. For the time being, there may be a cause in the XML file, so I will post it.
DatePicker datePicker1 = findViewById (R.id.datePicker1);
datePicker1.init (year, month, day, new DatePicker.OnDateChangedListener () {
@Override
public void onDateChanged (DatePicker view, int year, int monthOfYear, int dayOfMonth) {
// The part that is executed when the date is selected
Button button = findViewById (R.id.button);
}
});
<DatePicker
android: id = "@ + id/datePicker1"
android: layout_width = "wrap_content"
android: layout_height = "744dp"
android: layout_gravity = "center | top" />
<Button
android: id = "@ + id/button"
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: layout_gravity = "center | top"
android: text = "Button" />
-
Answer # 1
Related articles
- [unity, android development] about soft keyboard preview
- android studio - [flutter] about errors in screen transitions
- button color change in android studio
- android - i want to perform a screen transition and set the button tap event of the transitioned second screen to "display
- about android studio
- python - about the process of extracting the canceled data based on the absolute value in the data frame
- about android application development in java
- about android studio errors
- php - about button reference in jquery
- android - error about gif
- c # - about the process at the time of forced shutdown of windows form application
- about error in android studio xml file
- android - alertdialog action button changes
- android - about data sharing between scenes using unity scriptable object
- android studio - about error resolution of flutter package cover
- java - about type conversion of view in android studio
- vba - about the setting of the command button of the user form
- c # - about wpf x button control
- [css] about the reason why the button width changes due to the change of font-size
- about not being able to press the button you want to press with python scraping
Trends
- python - you may need to restart the kernel to use updated packages error
- php - coincheck api authentication doesn't work
- php - i would like to introduce the coincheck api so that i can make payments with bitcoin on my ec site
- [php] i want to get account information using coincheck api
- the emulator process for avd pixel_2_api_29 was killed occurred when the android studio emulator was started, so i would like to
- javascript - how to check if an element exists in puppeteer
- dart - flutter: the instance member'stars' can't be accessed in an initializer error
- sh - 'apt-get' is not recognized as an internal or external command, operable program or batch file
- i want to call a child component method from a parent in vuejs
- python 3x - typeerror: 'method' object is not subscriptable
Isn't it possible to achieve this by switching the display/non-display of buttons?
* Since the operation has not been confirmed, please make fine adjustments if it does not move.
·procedure
1. Add button hidden setting to XML file
2. Add processing to Java file to display the button when the date button is pressed
(If necessary, add some process to hide the button again)