我有一个 EditText,我已经为其设置了 onClickListener 并打开了 material Calendar
I am having one EditText for which i have set onClickListener and opening material Calendar
我有一个 EditText,我已为其设置了 onClickListener 并打开了 material 日历。问题是,当我在模拟器中使用 运行 应用程序时,它可以正常工作,但是当我在移动设备中使用 运行 时,它会停止单击编辑文本并显示错误
无法向调试器发送回复:管道损坏 + android
from_date.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view)
{
Calendar c = Calendar.getInstance();
int Year = c.get(Calendar.YEAR);
int Month = c.get(Calendar.MONTH);
int Day = c.get(Calendar.DAY_OF_MONTH);
flage_from=true;
flage_to=false;
datePickerDialog = DatePickerDialog.newInstance(MainActivity.this, Year, Month, Day);
datePickerDialog.setThemeDark(false);
datePickerDialog.showYearPickerFirst(false);
datePickerDialog.setAccentColor(Color.parseColor("#215f8b"));
// datePickerDialog.setTitle("Select Date");
datePickerDialog.show(getFragmentManager(), "DatePickerDialog");
}
});
@Override
public void onDateSet(DatePickerDialog view, int Year, int Month, int Day)
{
String date = Day + "/" + Month + "/" + Year;
if(flage_from){
from_date.setText(date);
}else {
to_date.setText(date);
}
}
我有一个 EditText,我已为其设置了 onClickListener 并打开了 material 日历。问题是,当我在模拟器中使用 运行 应用程序时,它可以正常工作,但是当我在移动设备中使用 运行 时,它会停止单击编辑文本并显示错误 无法向调试器发送回复:管道损坏 + android
from_date.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view)
{
Calendar c = Calendar.getInstance();
int Year = c.get(Calendar.YEAR);
int Month = c.get(Calendar.MONTH);
int Day = c.get(Calendar.DAY_OF_MONTH);
flage_from=true;
flage_to=false;
datePickerDialog = DatePickerDialog.newInstance(MainActivity.this, Year, Month, Day);
datePickerDialog.setThemeDark(false);
datePickerDialog.showYearPickerFirst(false);
datePickerDialog.setAccentColor(Color.parseColor("#215f8b"));
// datePickerDialog.setTitle("Select Date");
datePickerDialog.show(getFragmentManager(), "DatePickerDialog");
}
});
@Override public void onDateSet(DatePickerDialog view, int Year, int Month, int Day) {
String date = Day + "/" + Month + "/" + Year;
if(flage_from){
from_date.setText(date);
}else {
to_date.setText(date);
}
}