Springe zum Inhalt

The most common method found in the internet for keeping the display on is the one using a WakeLock: PowerManager.WakeLock mWakeLock; PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); mWakeLock = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, "HomeActivity"); mWakeLock.acquire(); // ... do your business ... mWakeLock.release(); However, there are much simpler ways: In your activity, call getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);… Weiterlesen

Create the activity via the manifest editor like this: Double click on AndroidManifest.xml in the package explorer. Click on the "Application" tab of the manifest editor Click on "Add.." under the "Application Nodes" heading (bottom left of the screen) Choose Activity from the list in the dialog that pops up (if you have the option, you want to create a new top-level element) Click on the "Name*" link under the "Attributes for" header (bottom right of the window) to create a class for the new activity.… Weiterlesen