1

画面をキャプチャするために MediaProjection API に取り組んでいます。

以下のコードを使用して Android システム アクティビティを呼び出し、画面をキャプチャしました。

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

上記のコードは、com.android.systemui.media.MediaProjectionPermissionActivity というシステム アクティビティを開始します。これにより、画面キャプチャを開始するためのダイアログが表示されます。

そのダイアログ テキストを変更する必要があり、カスタム テキストを使用する必要があります。

以下のような MediaProjectionPermissionActivity クラス コードを確認しました。

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();

システム アクティビティ内に表示されるダイアログ テキストを変更するには?

これについて私を助けてください。前もって感謝します。

4

1 に答える 1

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.

于 2015-09-23T20:15:30.930 に答える