1

I am working on MediaProjection API to capture the screen.

I have used the below code to call the android System Activity to capture the screen,

MediaProjectionManager mProjectionManager = (MediaProjectionManager)getSystemService(Context.MEDIA_PROJECTION_SERVICE);
startActivityForResult(mProjectionManager.createScreenCaptureIntent(),REQUEST_CODE);

The above code will start the system activity called com.android.systemui.media.MediaProjectionPermissionActivity. This will show the dialog to start the screen capture.

I need to change that dialog text and I have to use my custom text.

I have checked that MediaProjectionPermissionActivity class code which as below,

mDialog = new AlertDialog.Builder(this)
                .setIcon(aInfo.loadIcon(packageManager))

.setMessage(getString(R.string.media_projection_dialog_text, appName))

                .setPositiveButton(R.string.media_projection_action_text, this)
                .setNegativeButton(android.R.string.cancel, this)
                .setView(R.layout.remember_permission_checkbox)
                .setOnCancelListener(this)
                .create();

How to change the dialog text which is shown inside system activity?

Please help me on this. Thanks in advance.

M Vignesh
  • 1,586
  • 2
  • 18
  • 55

1 Answers1

3

I need to change that dialog text and I have to use my custom text.

Build your own custom ROM, where you replace the standard Android dialog text with your desired replacement. Install that custom ROM on your device.

You cannot replace that text from an app, for blindingly obvious privacy and security reasons.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • But my requirement is to use custom text in our app only, The answer is we can not achieve this because of security reason. Thanks. – M Vignesh Sep 23 '15 at 21:02