[JAVA] [Android] Get the date on Monday

//Get today's date
//Example: Today (9)/3(tue)→9/2(mon)To get)

//I am using a calendar because localDate cannot be used.
Date today = new Date();
Calendar day = Calendar.getInstance();

//Method to get monday
day.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
today = day.getTime();

//Format to String type (if necessary)
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
String strToday = sdf.format(today);

Recommended Posts

[Android] Get the date on Monday
[Android] Get the tapped position (coordinates) on the screen
Get JUnit code coverage on Android.
Get the acceleration and bearing of the world coordinate system on Android
How to get the date in java
[Java] Get the date with the LocalDateTime class
[Android] List all setting items on the setting screen
Get your version number in the Android app
[Ubuntu 20.04] Display the day of the week on the date / clock
[Android] Solution when the camera cannot be started on Android 9
[Android] Notes on xml
[Android] Display images and characters on the ViewPager tab
Run the Android emulator on Docker using Android Emulator Container Scripts
[Java] Get the date 10 days later with the Calendar class
[Android] How to get the setting language of the terminal
[Introduction] Display Android Studio Hello World on the emulator
I want to simplify the log output on Android
Until the Google Assistant sample runs on Android Things
Get Android location information
I found no way to get the error code when I received an exception on Android
Access Web API on Android with Get and process Json (Java for the time being)
About truncation by the number of bytes of String on Android
Get the next business day after the specified date in JAVA
[Swift 5] Select a date with the IDate Picker on iOS14
[Environment construction] Get the Ruby on Rails 6 development environment within 1 hour
Sample to get WiFi, Bluetooth beacon, sensor information on Android
Customize list view on Android
Multipart transmission library on Android
Use serial communication on Android
ROS app development on Android
Scala runs on the JVM
About the Android life cycle
Use native code on Android
Android Spot the Difference Game
[Java] Get date information 10 days later using milliseconds in the Date class
[Java1.8 +] Get the date of the next x day of the week with LocalDate
[Java] Get the dates of the past Monday and Sunday in order
Get the current date and time by specifying the time zone in Thymeleaf
I opened the menu bar (option menu) on Android and saw it.
[Android, Java] Method to find the elapsed date from two dates
[Android] I want to get the listener from the button in ListView