解决方案 »

  1.   

    4.4的分屏异显,不是显示两个app(至少目前还不能完善支持),是要用特定的api来写一个界面,在external display上显示。
    google给的方法是通过android.app.Presentation来写界面,在4.4的apiDemo中有例子的。
    另外就是setting的开发选项中,有一个“模拟显示设备”的选项可以模拟出一个屏幕出来去玩玩吧,配合api demos,可以看到两个screen显示不同内容的效果。
      

  2.   

    大神,我按照你说的,找到那个demo,但是为什么跑起来总是失败,编译没错,但是再手机上运行总是直接就闪退,这是logcat的信息求指导,是我引错了包,还是什么,我搞不清楚啊
      

  3.   

    你在哪个版本的android上跑的这个apk?看log是class找不到,应该是版本问题。
    另外你可以把那个presentation那个activity直接copy出来,自己做一个apk来跑。
      

  4.   

    谢谢谢谢,跑出来了,我也照样子自己写了个,也能跑,不过有个问题想请教,我最终实现的效果是希望这个presentation的音量和亮度与主activity是独立的,就是说调节presentation的音量,亮度时,不会影响到主屏
      

  5.   

    audio输出如果是一路的话好做一些,因为每个audiotrack都可以设置自己的volume,这样你可以在主屏的广告播放那调用mediaplayer的setVolume来控制他的音量,另外一个屏幕上的走系统的音量设置就好了。亮度设置和两路audio输出的控制,标准api没有,最好问下你用的平台的方案商。
      

  6.   

    大神,今天我弄的时候发现个问题,就是presentation必须要依赖于一个activity,demo中都是只有一个activity,确实没问题,但是我下面的小屏幕操作跳转之后,presentation之前的广告就没了,我试着把这个presentation做成一个全局变量,但是presentation的初始化还是要涉及到具体的一个activity,我现在想的只有是把他做成只有一个activity,然后下面用fragment的去替换,不过我们工程师也说最好别这样,因为下面的操作也很复杂,弄成fragment他们也会很难弄,帮我想想办法把,我也最多只能想到这个fragment了
      

  7.   

    做一个service啊,你可以把广告的屏幕作为第二屏幕,写一个带window的service,把这个window设置到第二屏幕上。
    设置window在第二屏幕的做法,你看看presentation里面怎么写的就知道了。
      

  8.   

    我采用的做法是把第二屏的加载全部写到service中,开启服务就好,但是这里就是presentation的初始化函数
    public Presentation (Context outerContext, Display display)Creates a new presentation that is attached to the specified display using the default theme.
    这里的outerContext必须要activity,不知道怎么处理啊
      

  9.   

    4.0我就看到有app做分屏了,只是不知道如何实现,,,
      

  10.   

    我采用的做法是把第二屏的加载全部写到service中,开启服务就好,但是这里就是presentation的初始化函数
    public Presentation (Context outerContext, Display display)Creates a new presentation that is attached to the specified display using the default theme.
    这里的outerContext必须要activity,不知道怎么处理啊
    没有说必须是activity,Presentation会自己建立一个新的context的,不是用传进来的context。
      

  11.   

    我采用的做法是把第二屏的加载全部写到service中,开启服务就好,但是这里就是presentation的初始化函数
    public Presentation (Context outerContext, Display display)Creates a new presentation that is attached to the specified display using the default theme.
    这里的outerContext必须要activity,不知道怎么处理啊
    没有说必须是activity,Presentation会自己建立一个新的context的,不是用传进来的context。
    The context of the application that is showing the presentation. The presentation will create its own context (see getContext()) based on this context and information about the associated display.
    你看,这是对那个context参数的解释,我知道presentation会创建自己的context,但是它是在这个参数context之上的啊
      

  12.   

    我采用的做法是把第二屏的加载全部写到service中,开启服务就好,但是这里就是presentation的初始化函数
    public Presentation (Context outerContext, Display display)Creates a new presentation that is attached to the specified display using the default theme.
    这里的outerContext必须要activity,不知道怎么处理啊
    没有说必须是activity,Presentation会自己建立一个新的context的,不是用传进来的context。
    The context of the application that is showing the presentation. The presentation will create its own context (see getContext()) based on this context and information about the associated display.
    你看,这是对那个context参数的解释,我知道presentation会创建自己的context,但是它是在这个参数context之上的啊
    你自己试过了吗?不行?
      

  13.   

    我采用的做法是把第二屏的加载全部写到service中,开启服务就好,但是这里就是presentation的初始化函数
    public Presentation (Context outerContext, Display display)Creates a new presentation that is attached to the specified display using the default theme.
    这里的outerContext必须要activity,不知道怎么处理啊
    没有说必须是activity,Presentation会自己建立一个新的context的,不是用传进来的context。
    The context of the application that is showing the presentation. The presentation will create its own context (see getContext()) based on this context and information about the associated display.
    你看,这是对那个context参数的解释,我知道presentation会创建自己的context,但是它是在这个参数context之上的啊
    你自己试过了吗?不行?
    额,当然试过,这里好像必须要填一个activity的context,而且这个activity跳转后presentation就消失了,如果说用getApplicationContext()就直接报错,也不行
      

  14.   

    我采用的做法是把第二屏的加载全部写到service中,开启服务就好,但是这里就是presentation的初始化函数
    public Presentation (Context outerContext, Display display)Creates a new presentation that is attached to the specified display using the default theme.
    这里的outerContext必须要activity,不知道怎么处理啊
    没有说必须是activity,Presentation会自己建立一个新的context的,不是用传进来的context。
    The context of the application that is showing the presentation. The presentation will create its own context (see getContext()) based on this context and information about the associated display.
    你看,这是对那个context参数的解释,我知道presentation会创建自己的context,但是它是在这个参数context之上的啊
    你自己试过了吗?不行?
    额,当然试过,这里好像必须要填一个activity的context,而且这个activity跳转后presentation就消失了,如果说用getApplicationContext()就直接报错,也不行
    那直接换window去做吧,本来挺简单的,用Presentation本来就是在绕圈子,没必要的。