是否有可能在Android的两个活动的应用程序? [英] Is it possible to have two active applications in android?

查看:151
本文介绍了是否有可能在Android的两个活动的应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Android中,是否有可能在一半屏幕显示一个应用程序(渲染视频)作为浮动窗口。而在同一时间与其他应用程序交互(例如聊天应用程序或其他应用程序。).The浮屏应用的新会是我的应用程序,它允许用户执行多任务处理。

In Android , Is it possible to display one application(rendering Video) as a floating screen in one half of the screen. and at the same time interacting with another application(e.g chat application or any other application. ).The floating screen appliction will be my application so that it will allow the user to do multitasking.

的思想是保持的应用,这是呈现视频,顶部的surfaceview,并在同一时间与其他applications.eg画廊或任何其他应用程序交互..

The idea is to keep the surfaceview of the application, which is rendering the video, on top, and at the same time interact with other applications.e.g gallery or any other application..

推荐答案

如果通过两个活动的应用程序,那么你的意思的真正的应用程序(即带有活动,回堆栈,和C)激活同一时间,那么没有(除了在一些专门的设备,用定制的API)。

If by "two active applications" then you mean real applications (i.e. with activities, back stack, &c) active at the same time, then no (except in some specialized devices, with custom APIs).

然而,有一个小窍门,你可以用它来实现类似的效果。与 android.permission.SYSTEM_ALERT_WINDOW (显示为画在其他应用程序,在Play商店),可以创建的从服务,并显示他们的窗口的应用。所以,你很可能得到这种方法你想要的效果。

However, there is a trick you can use to achieve a similar effect. Applications with the android.permission.SYSTEM_ALERT_WINDOW (displayed as "draw over other apps" in Play Store) can create windows from a service and show them. So you could probably get the effect you want with this method.

有一个名为突出一个开源库,它提供了一个易于使用的方式这种行为。你可能想看看吧。

There is an open source library called StandOut which provides this behavior in an easy to use manner. You might want to take a look at it.

这篇关于是否有可能在Android的两个活动的应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆