![]() ![]() ![]() ![]() (I'm sure the Music player works in the same way, so the example in the docs seems a bit misleading.) If that's the case, then your Activity can finish as usual and the Service will still be running.Ī simpler approach is to capture the Back button press and call moveTaskToBack(true) as follows: // 2. Solution 1 getWindow ().addFlags ( ) try using this flags to disable lock screen when the activity is started. open override fun onWindowAttributesChanged( p0: WindowManager.LayoutParams). Most of the time you need to create a Service to perform something in the background, and your visible Activity simply controls this Service. On honeycomb and above this will create an actionbar with the item to switch services Below honeycomb it will create the options menu bound to a hardware. Tried to access visual service WindowManager from a non-visual Context:35e268c Visual services, such as WindowManager, WallpaperService or LayoutInflater should be accessed from Activity or other visual Context. open fun moveTaskToBack( p0: Boolean): Boolean. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |