简体   繁体   中英

How to exit from Screen Pinning - Android 5 (Emulator)

Screen Pinning ( as mentioned on this page ) is a new feature introduced in Android 5 (Lollipop) which lets its users to temporarily lock only one Activity to the screen. All other notifications are hidden when screen pinning is activated.

Following steps can be taken to activate Screen Pinning

Users can enable screen pinning in Settings > Security > Screen Pinning, and select the tasks they want to pin by touching the green pin icon in the recents screen.

And to exit from Screen Pinning user can do the following

the user can exit by holding both the Back and Recent buttons

What I wanted to ask is

Is there any way to exit from Screen Pinning on Android Emulator for 5.0?, as we won't be able to press both Back and Recent buttons at same time with mouse?

Thanks.

您可以使用 adb 命令取消固定: adb shell am task lock stop

We cannot exit from the Screen Pinning Mode manually from the Emulator as we will not be able to press both Back button and Recents button at same time .

However if we restart the emulator the screen pinning is turned off automatically.

There is no other way around to do it.

If there is no 'hardware button' in your emulator to do just that, you could add a button in your app with the following functionality.

public void exitScreenPinning()
{
    try
    {
        stopLockTask();
    }
    catch (Exception e)
    {
        Log.d(TAG, "Screen was unlocked already.");
    }
}

That is, if you are using the screen pinning in your own app.

To exit from Screen Pinning, the Back button and recents button both should be pressed at same time. This is doable with certain combination. Press "Shift" button on middle of the button (center of back and recents button). Then press "Cmd" and move mouse - two "fingers" appear. Select back and recents buttons, press and hold for several seconds.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM