-1

How to check if my activity is in MultiWindowMode or not.

I have used Myactivity.isInMultiWindowMode() and MYactivity.isInPictureInPictureMode(), but showing error

Do I have to extend something as MultiWindow is not recognizing

I have gone through other post regarding multiwindow but no hope

Pranav Ashok
  • 581
  • 1
  • 6
  • 18

2 Answers2

0

Your Activity must extend AppCompatActivity and write code like this

 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
        if(isInMultiWindowMode && isInPictureInPictureMode){

        }
    }

This is not showing any type or error

Mohit Suthar
  • 8,725
  • 10
  • 37
  • 67
0

the problem was that you should precede isInMultiWindowMode() & isInPictureInPictureMode() with activity like getActivity() in android.

Pranav Ashok
  • 581
  • 1
  • 6
  • 18