简体   繁体   English

如何退出屏幕固定 - Android 5(模拟器)

[英]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.屏幕固定( 如本页所述)是 Android 5 (Lollipop) 中引入的一项新功能,它允许用户暂时只将一个 Activity 锁定到屏幕上。 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?有什么方法可以退出 Android Emulator for 5.0 上的屏幕固定?,因为我们无法用鼠标同时按下后退和最近按钮?

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.但是,如果我们restart the emulator ,屏幕固定会自动关闭。

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).按按钮中间的“Shift”按钮(返回和最近按钮的中心)。 Then press "Cmd" and move mouse - two "fingers" appear.然后按“Cmd”并移动鼠标 - 出现两个“手指”。 Select back and recents buttons, press and hold for several seconds.选择返回和最近按钮,按住几秒钟。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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