How to get First Day and last day of the week of a date
<p>I am using DatePickerDialog to show the calender. I want to access First day and last day of the week of the date selected.</p>

<p>Here is what I have tried</p>

<pre><code>     this.tv_date.setText( new StringBuilder()
        // Month is 0 based so add 1
                    .append(mDay).append("-")
                    .append(monthName).append("-")
                    .append(mYear).append(""));
        tv_date.setHighlightColor(Color.CYAN);

        String str=mDay+"-"+mMonth+"-"+mYear;

        SimpleDateFormat sdf=new SimpleDateFormat("dd-MM-yyyy");
        sdf.format(""+str); //here I am getting exception

        Calendar cal=Calendar.getInstance();

        int s=  cal.getFirstDayOfWeek();

        Toast.makeText(getApplicationContext(), "first day of the week : "+s, 1).show();
</code></pre>

<p>But I am getting "IllegalArguementException".
Please help me </p>

<p>Thanks</p>
