我试图在用户指定的时间显示一个弹出窗口?弹出窗口只显示在预编码的时间,所以我尝试了这个。现在我收到一条错误消息:int() argument must be a string, a bytes-like object or a number, not 'NoneType'
class MainApp(MDApp):
hour = NumericProperty(None, allowenone=True)
minute = NumericProperty(None, allowenone=True)
def build(self):
# calling the service
if platform == "android":
from android import AndroidService
service = AndroidService("my pong service", "running")
service.start("service started")
self.service = service
schedule.every().day.at(f'{int(self.hour)}:{int(self.minute)}').do(self.mantraPop_message)
#schedule.every().day.at(str(0) + str(self.hour) + ":" + str(self.minute)).do(self.show_notification)
Clock.schedule_interval(lambda dt: schedule.run_pending(), 1)
return MainScreen()
def show_timepicker(self):
picker = MDTimePicker()
picker.bind(time=self.got_time)
picker.open()
def got_time(self, picker_widget, time):
self.hour = time.hour
self.minute = time.minute
print(f'{int(self.hour)}:{int(self.minute)}')