Display android DatePicker on click of a button in Javascript

前端 未结 2 906
清酒与你
清酒与你 2021-01-03 12:38

Here is my requirement : I\'am loading one html file on to a WebView. I have a button in html file to select the date. When i click on that button i want to open android da

2条回答
  •  走了就别回头了
    2021-01-03 13:29

    public void openDatePickerDialog()
    { 
        Calendar c = Calendar.getInstance();
        mYear = c.get(Calendar.YEAR);
        mMonth = c.get(Calendar.MONTH);
        mDay = c.get(Calendar.DAY_OF_MONTH);
    
        //updateDisplay();
        DatePickerDialog dp = new DatePickerDialog(this,
                mDateSetListener,
                mYear, mMonth, mDay);
        dp.show();
    }
    

    can you try this once.

提交回复
热议问题