如何在用户打开YouTube的杀Android的过程 [英] How to kill Android process if user opens youtube

查看:110
本文介绍了如何在用户打开YouTube的杀Android的过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


  

可能重复:结果
  <一href=\"http://stackoverflow.com/questions/6531627/how-to-restrict-android-device-to-not-open-some-specific-site-e-g-youtube-facebo\">How限制Android设备无法打开一些特定的网站e.g.youtube,Facebook的


我写一个应用程序,一个功能是,如果用户打开youtube.com则不允许他这样做。

所以,我打算杀了Android的过程中,如果用户尝试打开它。我知道,这code终止进程

  android.os.Process.killProcess(PID);

但我怎样才能得到处理,如果它开放的YouTube的PID(进程ID)。问题是要得到它打开YouTube的进程ID。


解决方案

  

我写一个应用程序,一个功能是,如果用户打开youtube.com则不允许他这样做。


幸运的是,恶意软件编写者必须做这样的事情的能力有限。


  

所以,我打算杀了Android的浏览器进程,如果用户尝试打开它。


幸运的是,这是不可能的,至少在Android 2.1 +


  

我知道,这code终止进程


只有当您有权杀死该进程。幸运的是,你没有权限杀死进程。

Possible Duplicate:
How to restrict Android device to not open some specific site e.g.youtube, facebook

I am writing an application and a feature is that if the user opens youtube.com then not allow him to do this.

So I planned to kill the Android process if the user try to open it. I know that this code kills the process

android.os.Process.killProcess(pid);

but How can I get pid(process id) of process if it open youtube. The problem is to get process id which opens youtube.

解决方案

I am writing an application and a feature is that if the user opens youtube.com then not allow him to do this.

Fortunately, malware authors have limited ability to do things like this.

So I planned to kill the Android browser process if the user try to open it.

Fortunately, this is impossible, at least on Android 2.1+.

I know that this code kills the process

Only if you have rights to kill that process. Fortunately, you do not have rights to kill that process.

这篇关于如何在用户打开YouTube的杀Android的过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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