How to detect device back button event in codenameone
<p>We are developing an application in which we want to exit a login screen of press event of a device (hardware) back button.
  So can you please help me on that and tell me how I can  exit login screen on back button press event of device?
  If we want to exit App(application) then what should we do to exit App(application) on back press event of device.
  Thanks in advance</p>