Is it possible to have two active applications in android?

后端 未结 2 1885
一生所求
一生所求 2021-01-15 12:59

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 applica

相关标签:
2条回答
  • 2021-01-15 13:28

    In short, the answer is no. There is no way currently for multiple apps to be visible on the screen at the same time.

    You could theoretically reuse code over multiple different applications, so you could create a video window that could play video, while simultaneously showing a text editor fragment that allows notes to be taken, and you can send data between different applications using an Intent, but unlike modern desktop computers, only one application can currently have the focus of the screen at a time in Android.

    0 讨论(0)
  • 2021-01-15 13:29

    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).

    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.

    0 讨论(0)
提交回复
热议问题