Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is your solution. </p> <pre><code>Calendar mCalendar = new GregorianCalendar(); mCalendar.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY); SimpleDateFormat mDF = new SimpleDateFormat("dd MMMM"); String printDate = mDF.format(mCalendar.getTime()); mCalendar.add(Calendar.DAY_OF_MONTH, 6); String printDate2 = mDF.format(mCalendar.getTime()); System.out.println(printDate + " &gt;&gt; " + printDate2); gestureEvent.setText(printDate + " &gt;&gt; " + printDate2); </code></pre> <hr> <p><strong>Update for implementation on button</strong> </p> <p>Write a method, which will take weekNumber as params.. </p> <pre><code>private static String getNextWeek(int weekFromToday) { Calendar mCalendar = new GregorianCalendar(); mCalendar.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY); mCalendar.set(Calendar.WEEK_OF_YEAR, mCalendar.get(Calendar.WEEK_OF_YEAR) + weekFromToday); SimpleDateFormat mDF = new SimpleDateFormat("dd MMMM"); String printDate = mDF.format(mCalendar.getTime()); System.out.println(printDate); //gestureEvent.setText(reportDate); mCalendar.add(Calendar.DAY_OF_MONTH, 6); String printDate2 = mDF.format(mCalendar.getTime()); System.out.println(printDate + " &gt;&gt; " + printDate2); return printDate + " &gt;&gt; " + printDate2; } </code></pre> <p>Now declaire a static filed as </p> <pre><code>private static int weekNumber = -1; </code></pre> <p>and write below code on button click</p> <pre><code>weekNumber = weekNumber + 1; gestureEvent.setText(getNextWeek(weekNumber)); </code></pre> <p>This will work.</p> <p><em><strong>Happy coding :)</em></strong></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload