Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/shell/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 当用户尝试截图时,更改截图块文本并点击web api_Android_Android Intent_Screenshot - Fatal编程技术网

Android 当用户尝试截图时,更改截图块文本并点击web api

Android 当用户尝试截图时,更改截图块文本并点击web api,android,android-intent,screenshot,Android,Android Intent,Screenshot,我正在阻止我的应用程序截图。为此,我使用getWindow().addFlags(WindowManager.LayoutParams.FLAG\u SECURE) 当用户想要截图时,我收到消息“无法保存截图,Stroage可能正在使用”。我想根据我的要求自定义此邮件。另外,当用户尝试截图时,我想点击WebAPI 我正在使用下面的代码,但没有成功 public void detectScreenShotService(final Activity activity){ fina

我正在阻止我的应用程序截图。为此,我使用
getWindow().addFlags(WindowManager.LayoutParams.FLAG\u SECURE)

当用户想要截图时,我收到消息“无法保存截图,Stroage可能正在使用”
。我想根据我的要求自定义此邮件。另外,当用户尝试截图时,我想点击WebAPI

我正在使用下面的代码,但没有成功

public void detectScreenShotService(final Activity activity){

        final Handler h = new Handler();
        final int delay = 3000; //milliseconds
        final ActivityManager am=(ActivityManager)activity.getSystemService(Context.ACTIVITY_SERVICE);

        h.postDelayed(new Runnable(){
            public void run(){

                List<ActivityManager.RunningServiceInfo> rs=am.getRunningServices(200);

                for(ActivityManager.RunningServiceInfo ar:rs){
                    if(ar.process.equals("com.android.systemui:screenshot")){
                        Log.e("tag", "Screenshot captured!!");
                    }
                }
                h.postDelayed(this, delay);
            }
        }, delay);

    }
public void detectScreenShotService(最终活动){
最终处理程序h=新处理程序();
最终整数延迟=3000;//毫秒
最终ActivityManager am=(ActivityManager)activity.getSystemService(Context.activity_服务);
h、 postDelayed(新的Runnable(){
公开募捐{
列表rs=am.getRunningServices(200);
对于(ActivityManager.RunningServiceInfo ar:rs){
if(ar.process.equals(“com.android.systemui:screenshot”)){
Log.e(“标签”,“截图!!”);
}
}
h、 postDelayed(这个,延迟);
}
},延误);
}

在所有活动中的
setContentView
之前添加这一行代码

getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE,
                WindowManager.LayoutParams.FLAG_SECURE);

我也在做同样的事情,我怎样才能改变写着“不能截图”的祝酒词。@theLazyFinder我想这是不能改变的,我试着在同一条上搜索。如果你克服了这个问题,请让我知道