timepicker

How to fix MainActivity cannot be cast to android.app.TimePickerDialog$OnTimeSetListener in a fragment?

我与影子孤独终老i 提交于 2020-07-23 06:53:27
问题 i'm doing my school project in android since days ago, and I got a problem today. I did a menu with fragments and I need to put a TimePickerDialog inside a fragment and for me it's impossible, everytime when I press the button lo launch the Dialog the app crashes. I try to put implements in the class of the TimePickerFragment but it doens't work, I need to bring the things in my main fragment, not in the Dialog. Here is my main fragment, called "DespertarFragment": @Override public View

TimePickerFragment Not Working

雨燕双飞 提交于 2020-05-15 08:09:46
问题 According to the official Android Dev guide, when the user clicks this button, the system calls the following method: public void showTimePickerDialog(View v) { DialogFragment newFragment = new TimePickerFragment(); newFragment.show(getSupportFragmentManager(), "timePicker"); } However, when I try this in my Fragment Activity, it shows TimePickerFragment in red. And prompts that TimePickerFragment() cannot be resolved. These are my imports related to TimePicker : import android.app

TimePickerFragment Not Working

我们两清 提交于 2020-05-15 08:09:29
问题 According to the official Android Dev guide, when the user clicks this button, the system calls the following method: public void showTimePickerDialog(View v) { DialogFragment newFragment = new TimePickerFragment(); newFragment.show(getSupportFragmentManager(), "timePicker"); } However, when I try this in my Fragment Activity, it shows TimePickerFragment in red. And prompts that TimePickerFragment() cannot be resolved. These are my imports related to TimePicker : import android.app

Angular-Material DateTime Picker Component?

那年仲夏 提交于 2020-05-10 07:02:10
问题 I imported a date picker in a project and was wondering if there was any official recent component from angular and material to include time in the calendar as well. I've seen plenty of time pickers in material documentation and researched a lot of third party ones, but they seem very complex. 回答1: Unfortunately, the answer to your question of whether there is official Material support for selecting the time is "No", but it's currently an open issue on the official Material2 GitHub repo:

Xamarin.Forms Android DatePicker/TimePicker button listener

天大地大妈咪最大 提交于 2020-04-11 08:13:50
问题 I need to know if a user tapped on the Cancel or Ok button in a Date/Time picker of an xamarin.Forms Android app. I have tried to add a function to the Click event but this is never triggered. This is my code (similar for the TimePicker): using Android.Content; using MyApp.Droid; using Xamarin.Forms; using Xamarin.Forms.Platform.Android; using MyApp.Models; using Java.Util; [assembly: ExportRenderer(typeof(DatePicker), typeof(DatePickerCustomRenderer))] namespace MyApp.Droid { public class

Xamarin.Forms Android DatePicker/TimePicker button listener

元气小坏坏 提交于 2020-04-11 08:12:11
问题 I need to know if a user tapped on the Cancel or Ok button in a Date/Time picker of an xamarin.Forms Android app. I have tried to add a function to the Click event but this is never triggered. This is my code (similar for the TimePicker): using Android.Content; using MyApp.Droid; using Xamarin.Forms; using Xamarin.Forms.Platform.Android; using MyApp.Models; using Java.Util; [assembly: ExportRenderer(typeof(DatePicker), typeof(DatePickerCustomRenderer))] namespace MyApp.Droid { public class

Android基础——闹钟

女生的网名这么多〃 提交于 2020-01-30 23:27:25
有两个活动:一个是Main,用来设定闹钟,另一个是闹钟到点提示的活动Alarm Main布局文件 <?xml version="1.0" encoding="utf-8"?> <TimePicker xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".MainActivity"> <TimePicker android:id="@+id/time" android:layout_width="wrap_content" android:layout_height="wrap_content"/> <Button android:id="@+id/button" android:layout_width="wrap_content" android:layout_height="wrap

Bootstrap 时间控件timepicker与datepicker

和自甴很熟 提交于 2020-01-24 00:17:21
timepicker 1 <div class="col-md-4" style="display: -webkit-inline-box;padding-left:0px"> 2 <div class="input-group"> 3 <input type="text" id="startTime" name="startTime" 4 readonly="readonly" class="form-control timepicker timepicker-default" placeholder="从"> 5 <span class="input-group-btn"> 6 <button class="btn default" type="button"> 7 <i class="fa fa-clock-o"></i> 8 </button> 9 </span> 10 </div> 11 12 </div> 13 <div class="col-md-4"> 14 <div class="input-group"> 15 <input type="text" id="endTime" name="endTime" 16 readonly="readonly" class="form-control timepicker timepicker-default"

Android: TimePickerDialog - TimePickerDialog.OnTimeSetListener

微笑、不失礼 提交于 2020-01-21 09:54:07
问题 I am a newbie to Android. Here I am again with another "simple" question. I hope you can help me. I just want a button that displays a TimePicker in a dialog. When I set the time in the timepicker, I would like to get the selected time. I am using the Android support library and ActionbarSherlock. Here is my code: AddPeriod.java import android.app.AlertDialog; import android.app.TimePickerDialog; import android.content.DialogInterface; import android.os.Bundle; import android.support.v4.app

How do i change the Android TimePicker minute intervals?

别说谁变了你拦得住时间么 提交于 2020-01-21 00:50:34
问题 I am writing an application where the user needs to specify a given point in time, but i can't seem to figure out how to set the minute values that the user can choose from, to only use increments of 5 instead of increments of 1. Simply put, when the user scrolls through the available amounts, he/she must only see 0,5,10,15 etc. Thank you in advance. 回答1: To ensure you're compatible with API 21+, make sure your TimePicker has the following attribute: android:timePickerMode="spinner" Then here