【问题标题】:Launch another application in secondary screen in Android_O在 Android_O 的辅助屏幕中启动另一个应用程序
【发布时间】:2018-08-06 14:44:18
【问题描述】:

设备有两个屏幕。在第一个屏幕正常 UI(启动器应用程序)中,在第二个屏幕启动谷歌地图应用程序。

我们如何启动另一个应用程序的辅助屏幕。

Service class:
@Override
protected View buildPresoView(Context ctxt, LayoutInflater inflater) {
View topView = new View(this);
  topView.setOnClickListener(new View.OnClickListener() {

      @Override
      public void onClick(View arg0) {
          Intent i = getPackageManager().getLaunchIntentForPackage("abc.abc.abc");
  startActivity(i);
      }
  });

    inflater = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View contentView = inflater.inflate(R.layout.display, null,false);    

    return(topView);
   //return(contentView);
  }
 PresentationHelper:
 @Override
public void showPreso(Display display) {
Context presoContext=createPresoContext(display);
LayoutInflater inflater=LayoutInflater.from(presoContext);
wm=(WindowManager)presoContext.getSystemService(Context.WINDOW_SERVICE);
presoView=buildPresoView(presoContext, inflater);
wm.addView(presoView, buildLayoutParams());
}

我点击了这个链接: Run a separate application on secondary monitor

【问题讨论】:

    标签: android android-windowmanager presentation multiscreen


    【解决方案1】:

    首先检查演示模式是否在设备级别启用(IN aosp)。 如果没有在设备.xml文件中添加以下标签。

    <feature name="android.software.activities_on_secondary_displays" />
    

    【讨论】:

    • 现在使用上述标志启用演示模式。但应用程序没有从一个应用程序启动到另一个应用程序
    • 这个标签必须加在哪里?
    猜你喜欢
    • 2011-09-25
    • 1970-01-01
    • 2016-10-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多