How to display permission dialog without going back to app

43 views Asked by At

I want to display the permission dialog without going back to my Activity [enter image description here](https://i.stack.imgur.com/iF5eT.jpg)

I tried asking AI but it said that I cannot display it I develop an app that captures screenshot

here's the permission code



public void requestRecordingPermission() {

        new Thread(new Runnable() {

            @Override

            public void run() {

                mediaProjectionManager = (MediaProjectionManager) getSystemService(Context.MEDIA_PROJECTION_SERVICE);

                Intent screenShot = mediaProjectionManager.createScreenCaptureIntent();

                startActivityForResult(screenShot, 30);

              

            }

        }).start();

    }


here's my Activity result

`

    if (requestCode == 30 && resultCode == RESULT_OK) {

        mediaProjection = mediaProjectionManager.getMediaProjection(resultCode, data);

    }`
0

There are 0 answers