单击应用图标全屏显示图片中的图片

问题描述

我正在使用jitsi-android-sdk,在其中,当我单击主屏幕时,它将带我进入图片模式的图片,而当我单击该应用程序时,将带我返回第一表单页面。单击应用程序时,应如何在图片模式下全屏显示图片

我应该在onResume()中放入什么,以便在单击该应用程序时可以全屏显示图片

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

我想在我的android应用中实现相同的行为。

enter image description here

解决方法

当应用在该活动的图片上进行画中画法时,首先检查该活动将处于暂停状态,然后添加此代码。

@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));
        }
    }

我使用共享的首选项来跟踪会议的进行与否。

如果您想详细了解,请关注this