Question: My application makes a call to the server which may take a few seconds. The user can minimize the App before receiving the response from the server.

So what I am trying to do is that if the App is minimized when it receives the response from the server, it will go to PIP mode.

When I try to enter Pip mode with the application minimized I get this error:

```
java.lang.IllegalStateException: Activity must be resumed to enter picture-in-picture

```

The error occurs when this line is executed:

```
enterPictureInPictureMode();

```

Thanks.

Answer: 
Finally I found out, the problem comes from the installation of the server.
I used to change the my.cnf as usual, and some variables are changed at each restart and others no.

And I realised that there is an other conf file, and this file orverwrite the changes I have made in the my.cnf file for some variables...
Now I change the good file, and the server is working as excepting.

So if mariaDB ignore your changes in the conf file check if there is an other file.
Simple, stop using persistent connections and restart the server.