问题标签 [datepickerdialog]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
1003 浏览

android - 在 DatePickerDialog android 上设置 MinDate 的问题

我在 Android 中使用来选择日期范围,DatePickerDialog我可以在. 但是在 Lollipop 下面执行相同的操作时,它会抛出异常。minDateMaxDateLolliPop (5+)

使用的代码:

结果:在 Android Lollipop 中运行良好。在其他较低版本中出现异常崩溃

这是异常消息

请帮忙...

0 投票
2 回答
4735 浏览

android - 在 Lollipop 设备中使用 Kit Kat DatePicker

我正在尝试DatePickerDialog在我的应用程序中显示 a 。但我意识到DatePickerDialog显示的内容取决于手机操作系统。我的问题是如何在操作系统中显示KitKat风格?我知道这是可能的,因为 Facebook 等一些应用程序正在使用它。DatePickerLollipop

这就是我要的

日期选择器

0 投票
1 回答
107 浏览

android - DatePickerDialog & TimePickerDialog onXXXSet() Version 17 +/- Issue

Note, I apologize up front if this is already out there. In trying to figure this out, I found pieces of this out there, but never this whole issue & solution. So I thought I would write it up for the rest of the community.

There are lots of questions/answers out there on DatePickerDialogs (and TimePickerDialogs about how to capture the date/time set using onDateSet().

I found a nuance in this dialog functionality that produces what looks like a bug version 17 and below and I found a solution.

Here is the issue...

As has been stated out there, if you want to capture the date set upon leaving the DatePickerDialog you write and onDateSet() method and set the listener on the DatePickerDialog (typical as "this"). For example:

Notice that this that is passing the MyDatePickerFragment into the DatePickerDialog as the onDateSet() listener.

This works fine in android versions 17 and below. Try version 18 or higher and basically nothing happens. Your date set activities get lost. So another suggestion (I found) was to to add the following code to the onCreateDialog():

This works great for any version 18 or greater. That said, if you just add this to the onCreateDialog() then your version 17 and under quits working. Comment out this code version 17 and under works. Put it in, it quits and 18 and over works.

To fix this, I implemented it this way:

Voila...!! Now both work. This same paradigm works for the TimePickerDialog as well.

I hope this helps.

0 投票
1 回答
521 浏览

java - 日期选择器对话框。设置无效日期时如何重新打开它

好的。所以我制作了一个日期选择器对话框,该对话框在 TextView Click 上打开。这部分工作正常。当我有 2 个日期时,我的问题就会发生。如果第二个日期早于第一个日期,那么日期选择器应该重新打开并要求一个新的“有效”日期。这就是我遇到问题的地方。我现在的代码(如下)告诉我日期是否错误,但不会重新打开日期选择器以允许我设置新日期。我该怎么做呢?我尝试制作一种新方法,并在其中使用不同的 datepickerdialog 使用相同的代码,但这会将 2 个 datepicker 重叠在一起,并且选择的日期始终来自第二个。

0 投票
1 回答
2446 浏览

android - 在日期选择器对话框中获取当前日期

当用户单击但它不起作用时,我想在日期选择器对话框上获取当前日期。我的默认日期不会更改为我当前的日期。我在我的代码中做错了什么?

0 投票
3 回答
2700 浏览

android - Datepicker not showing when clicked the first time

I have a editfield and when I click on it a datepicker will open but I am not able to get the datepicker to popup when clicked for first time. If I click the editfield the first time, the datepicker does not appear. When I click the second or third time, it is showing. Here is my code:

0 投票
0 回答
269 浏览

android - 更改时区时,DatePickerDialog 在 android 5.1 中显示异常行为

我必须使用 DatePickerDialog 显示日历。

使用以下代码:

当应用程序运行时,我转到设置并将时区更改为这样的值,以便当前日期会更改。现在,当我们在对话框中选择任何日期时,它的行为异常并转到其他日期。我使用了 setMinDate() 和 setMaxDate() 方法。这仅在 Android OS 5.1 中发生。任何想法或帮助?提前致谢。

0 投票
1 回答
973 浏览

android - 将 DatePickerDialog 和 TimePickerDialog 更新为当前日期和时间

我是 android 新手,我正在开发我的第一个基于位置的提醒应用程序,我正在添加包含位置、日期和时间的任务,当我到达时应该通知我。在添加任务活动中,我有任务名称、位置、日期和时间按钮(当单击 DatePickerDialog 并显示 TimePickerDialog 时)和一个 AddTask 按钮。当我给出所有值并按下 AddTask 按钮时,我想将 DatePickerDialog 和 TimePickerDialog 重置为当前日期和时间。我的问题是它显示了我最近为任务设置的值..如何更新对话框的..请帮助..

0 投票
1 回答
627 浏览

android - 阻止用户在 datepickerdialog 和 timepickerdialog android 中选择过去的日期和时间

我正在开发我的第一个基于位置的提醒应用程序,我正在添加带有位置和日期和时间的任务,当我到达时应该通知我。在添加任务活动中,我有任务名称、位置、日期和时间按钮(当单击 DatePickerDialog 并显示 TimePickerDialog 时)和一个 AddTask 按钮。我想阻止用户从对话框中选择过去的日期和时间。我怎样才能做到这一点... ?

}

0 投票
4 回答
14837 浏览

android - 不可能让我的 DatePickerDialog 以编程方式使用微调器样式

我正在使用 aDialogFragment打开一个DatePickerDialog

我得到一个日历外观,我更喜欢微调器外观。

我试过了:

但它不起作用。

请注意,我希望微调器查找一项活动,但我希望日历视图用于另一项活动。所以我不能改变整个应用程序的风格。我需要一个活动的自定义样式。