如何改变媒体投影机API系统活动(MediaProjectionPermissionActivity)所示的android警报对话框文本? [英] How to change the Media Projector API system activity(MediaProjectionPermissionActivity) shown alert dialog text in android?

查看:1244
本文介绍了如何改变媒体投影机API系统活动(MediaProjectionPermissionActivity)所示的android警报对话框文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作MediaProjection API截取屏幕。

我用下面的code调用Android系统的活动来捕捉屏幕,

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

以上code将启动名为com.android.systemui.media.MediaProjectionPermissionActivity系统活动。这将显示对话框,启动屏幕捕获。

我需要更改对话框文本,我必须用我的自定义文本。

我已签了MediaProjectionPermissionActivity类code这下面,

 支持mDialog =新AlertDialog.Builder(本)
                .setIcon(aInfo.loadIcon(软件包管理系统))


  

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


  .setPositiveButton(R.string.media_projection_action_text,这一点)
                .setNegativeButton(android.R.string.cancel,这一点)
                .setView(R.layout.remember_permission_checkbox)
                .setOnCancelListener(本)
                。创建();

如何改变其系统内的活动所示的对话框文本?

请帮我在这。
提前致谢。


解决方案

  

我需要更改对话框文本,我必须用我的自定义文本。


构建自己的定制ROM,在那里你与你的期望更换更换标准Android对话文本。在设备上安装的自定义ROM。

您不能从一个应用程序替换文本,再明显的隐私和安全方面的原因。

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.

解决方案

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.

这篇关于如何改变媒体投影机API系统活动(MediaProjectionPermissionActivity)所示的android警报对话框文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆