我正在尝试在基于导航的应用程序中实现PIP模式。 应用程序使用诺基亚HERE Maps SDK作为地图引擎。 该应用程序在没有PIP的情况下可以正常运行,可以进入后台,在没有PIP的情况下可以继续运行。
但是在使用PIP模式时,PIP窗口不会更新,在该窗口上看不到用户位置/速度更新。有时我会听到TTS机动指令。
此外,当我尝试最大化PIP窗口时,它会导致屏幕冻结,并且大约10秒钟后我无法恢复。一段时间后,应用程序恢复到正常状态并按照预期方式显示运动。
我不知道为什么应用程序会如此运行。
我已使用此代码实现PIP模式。
try {
Display display = getWindowManager().getDefaultDisplay();
Point size = new Point();
display.getSize(size);
int width = size.x;
int height = size.y;
Rational aspectRatio = new Rational(width,height);
PictureInPictureParams.Builder mPictureInPictureParamsBuilder = new PictureInPictureParams.Builder();
mPictureInPictureParamsBuilder.setAspectRatio(aspectRatio).build();
enterPictureInPictureMode(mPictureInPictureParamsBuilder.build());
} catch (IllegalStateException e) {
e.printStackTrace();
}
请任何人告诉我我的错误。