def FlashLight(): phone = Ui.Phone() lock = Ui.WakeLock() try: # no screen dim lock.bright() # set max screen brightness, but has no effect old_bright = phone.brightness(255) # show a white black screen gui = Ui.TextView(background='#ffffffff') gui.mainloop('FlashLight') # restore screen brightness phone.brightness(old_bright) finally: lock.release()