点击应用图标后,全屏显示画中画内容。

huangapple go评论62阅读模式
英文:

On click of app icon full screen the picture in picture content

问题

我正在使用jitsi-android-sdk,在其中当我点击主屏幕时,它会将我带到画中画模式,当我点击应用程序时,它会将我带回第一个表单页面。在我点击应用程序时,应该如何使画中画模式全屏显示?

onResume()中我应该放入什么内容,以便我可以在点击应用程序时全屏显示画中画模式。

例如,当我们使用Netflix在移动设备上观看电影时,当我们按下主屏幕按钮时,它会进入画中画模式,当我们点击应用程序图标时,它会将画中画模式全屏显示(返回到正在全屏观看的电影)。

我想在我的Android应用程序中实现相同的行为。

点击应用图标后,全屏显示画中画内容。

英文:

I am using jitsi-android-sdk in which when I go click home screen it takes me to the picture in picture mode and when I click on the app takes me back to the first form page. How should full screen the picture in picture mode when I click on the app?

what should I put in onResume() so I can full-screen picture in picture on click of the app.

For example, When we are using Netflix and watching a movie on mobile when we press the home button it enters the picture in picture mode and when we click on the app icon it fullscreen the picture in picture mode (return to the movie in fullscreen which we are watching)

I want to implement the same behavior in my android app.

点击应用图标后,全屏显示画中画内容。

答案1

得分: 0

以下是翻译好的代码部分:

@Override
protected void onResume() {
    super.onResume();
    SharedPreferences sharedpreferences = getSharedPreferences("MyPrefs", Context.MODE_PRIVATE);
    
    // 从共享偏好中获取布尔值,该值是在点击加入会议按钮时存储的
    boolean check = sharedpreferences.getBoolean(met,false);
    if (check){
        // 如果正在进行会议,则重定向到会议界面

        // 用你的画中画活动类替换 JitsiMeetAcitvity.class
        startActivity(new Intent(this, JitsiMeetActivity.class)
                .addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT));
    }
}

我已使用共享偏好来跟踪会议是否正在进行。

如果你想了解更详细信息,请参阅此链接

英文:

The first check which activity is going to paused state when the app goes picture in picture on that activity onResume() method add this code.

@Override
    protected void onResume() {
        super.onResume();
        SharedPreferences sharedpreferences = getSharedPreferences("MyPrefs", Context.MODE_PRIVATE);

        //get boolean value from shared preferences which we are store when joining meeting button is clicked
        boolean check = sharedpreferences.getBoolean(met,false);
        if (check){
            //if meeting is going on redirect to meeting

            //Replace JitsiMeetAcitvity.class with your picture in picture activity class
            startActivity(new Intent(this, JitsiMeetActivity.class)
                    .addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT));
        }
    }

I have used the shared preferences to keep the track of the meeting is going on or not.

If you want to see in detail Follow this

huangapple
  • 本文由 发表于 2020年10月27日 16:04:03
  • 转载请务必保留本文链接:https://go.coder-hub.com/64550280.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定