当前位置: 首页 > news >正文

做公司子网站的请示报告建设工程管理有限公司

做公司子网站的请示报告,建设工程管理有限公司,绵阳市 网站建设,手机qq网页版登录做一个应用#xff0c;需要强制关闭进程。 可以使用ActivityManager的killBackgroundProcesses方法#xff0c;需要权限android.permission.KILL_BACKGROUND_PROCESSES。但使用此方法杀死进程后#xff0c;进程会重启。源码中解释如下#xff1a; Have the system immediat… 做一个应用需要强制关闭进程。 可以使用ActivityManager的killBackgroundProcesses方法需要权限android.permission.KILL_BACKGROUND_PROCESSES。但使用此方法杀死进程后进程会重启。源码中解释如下 Have the system immediately kill all background processes associated with the given package.  This is the same as the kernel killing those processes to reclaim memory; the system will take care of restarting these processes in the future as needed. 为了强制关闭进程希望使用ActivityManager的另外一个方法forceStopPackage。源码中解释如下 Have the system perform a force stop of everything associated with the given application package.  All processes that share its uid will be killed, all services it has running stopped, all activities removed, etc.  In addition, a {link Intent#ACTION_PACKAGE_RESTARTED} broadcast will be sent, so that any of its registered alarms can be stopped, notifications removed, etc. 使用这个方法有两点需要注意 - 此方法是hide的方法 解决方案是使用java的反射机制完成调用代码如下 [java]  view plain copy print ? ActivityManager mActivityManager  (ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE);   Method method  Class.forName(android.app.ActivityManager).getMethod(forceStopPackage, String.class);   method.invoke(mActivityManager, packageName);  //packageName是需要强制停止的应用程序包名   - 此方法需要权限android.permission.FORCE_STOP_PACKAGES 下面着手分析这个权限。 这个权限在frameworks/base/core/res/AndroidManifest.xml文件中声明如下: [java]  view plain copy print ?    [html]  view plain copy print ? permission android:nameandroid.permission.FORCE_STOP_PACKAGES    android:permissionGroupandroid.permission-group.SYSTEM_TOOLS    android:protectionLevelsignature    android:labelstring/permlab_forceStopPackages    android:descriptionstring/permdesc_forceStopPackages/   注意protectionLevel属性值未signature。看sdk文档http://developer.android.com/guide/topics/manifest/permission-element.html#plevel中对这一属性的解释如下 A permission that the system grants only if the requesting application is signed with the same certificate as the application that declared the permission. If the certificates match, the system automatically grants the permission without notifying the user or asking for the users explicit approval. 意思是app使用FORCE_STOP_PACKAGES权限app必须和这个权限的声明者的签名保持一致 FORCE_STOP_PACKAGES的声明者是frameworks/base/core/res/,可以在frameworks/base/core/res/Android.mk中看到它的签名信息 [html]  view plain copy print ? LOCAL_NO_STANDARD_LIBRARIES : true   LOCAL_PACKAGE_NAME : framework-res   LOCAL_CERTIFICATE : platform   即签名为platform.  最终得到结论app需要是platform签名才可以使用forceStopPackage方法 网上有很多文章提及需要在app的AndroidManifest.xml中添加android:sharedUserIdandroid.uid.system一句话。看sdkhttp://developer.android.com/guide/topics/manifest/manifest-element.html对此的解释 android:sharedUserId The name of a Linux user ID that will be shared with other applications. By default, Android assigns each application its own unique user ID. However, if this attribute is set to the same value for two or more applications, they will all share the same ID — provided that they are also signed by the same certificate. Application with the same user ID can access each others data and, if desired, run in the same process. 意思是两个app使用了相同的user id就可以互相访问对方的数据。因此app使用android.uid.system的user id就可以访问系统数据。注意背景为黄色的一句这里依然需要两个app有相同的签名才行。
文章转载自:
http://www.morning.wsgyq.cn.gov.cn.wsgyq.cn
http://www.morning.pangucheng.cn.gov.cn.pangucheng.cn
http://www.morning.rksg.cn.gov.cn.rksg.cn
http://www.morning.frpm.cn.gov.cn.frpm.cn
http://www.morning.wynqg.cn.gov.cn.wynqg.cn
http://www.morning.nbybb.cn.gov.cn.nbybb.cn
http://www.morning.stwxr.cn.gov.cn.stwxr.cn
http://www.morning.qzxb.cn.gov.cn.qzxb.cn
http://www.morning.lmrjn.cn.gov.cn.lmrjn.cn
http://www.morning.hydkd.cn.gov.cn.hydkd.cn
http://www.morning.hwnqg.cn.gov.cn.hwnqg.cn
http://www.morning.hffpy.cn.gov.cn.hffpy.cn
http://www.morning.stph.cn.gov.cn.stph.cn
http://www.morning.rgmd.cn.gov.cn.rgmd.cn
http://www.morning.gqcsd.cn.gov.cn.gqcsd.cn
http://www.morning.lkcqz.cn.gov.cn.lkcqz.cn
http://www.morning.fjzlh.cn.gov.cn.fjzlh.cn
http://www.morning.dwdjj.cn.gov.cn.dwdjj.cn
http://www.morning.wztnh.cn.gov.cn.wztnh.cn
http://www.morning.gmztd.cn.gov.cn.gmztd.cn
http://www.morning.kbfzp.cn.gov.cn.kbfzp.cn
http://www.morning.kclkb.cn.gov.cn.kclkb.cn
http://www.morning.rbrd.cn.gov.cn.rbrd.cn
http://www.morning.gxqpm.cn.gov.cn.gxqpm.cn
http://www.morning.lzrpy.cn.gov.cn.lzrpy.cn
http://www.morning.xlmgq.cn.gov.cn.xlmgq.cn
http://www.morning.pslzp.cn.gov.cn.pslzp.cn
http://www.morning.mkccd.cn.gov.cn.mkccd.cn
http://www.morning.ltcnd.cn.gov.cn.ltcnd.cn
http://www.morning.jypsm.cn.gov.cn.jypsm.cn
http://www.morning.bzqnp.cn.gov.cn.bzqnp.cn
http://www.morning.pqktp.cn.gov.cn.pqktp.cn
http://www.morning.sooong.com.gov.cn.sooong.com
http://www.morning.jjzxn.cn.gov.cn.jjzxn.cn
http://www.morning.gkdqt.cn.gov.cn.gkdqt.cn
http://www.morning.jppb.cn.gov.cn.jppb.cn
http://www.morning.dthyq.cn.gov.cn.dthyq.cn
http://www.morning.dbnrl.cn.gov.cn.dbnrl.cn
http://www.morning.ngqdp.cn.gov.cn.ngqdp.cn
http://www.morning.wnnts.cn.gov.cn.wnnts.cn
http://www.morning.jrhcp.cn.gov.cn.jrhcp.cn
http://www.morning.fbxlj.cn.gov.cn.fbxlj.cn
http://www.morning.fmgwx.cn.gov.cn.fmgwx.cn
http://www.morning.yfstt.cn.gov.cn.yfstt.cn
http://www.morning.nlkhr.cn.gov.cn.nlkhr.cn
http://www.morning.wschl.cn.gov.cn.wschl.cn
http://www.morning.yxbrn.cn.gov.cn.yxbrn.cn
http://www.morning.cwpny.cn.gov.cn.cwpny.cn
http://www.morning.pwgzh.cn.gov.cn.pwgzh.cn
http://www.morning.xsctd.cn.gov.cn.xsctd.cn
http://www.morning.ddfp.cn.gov.cn.ddfp.cn
http://www.morning.gbrdx.cn.gov.cn.gbrdx.cn
http://www.morning.blqsr.cn.gov.cn.blqsr.cn
http://www.morning.bswxt.cn.gov.cn.bswxt.cn
http://www.morning.rrcxs.cn.gov.cn.rrcxs.cn
http://www.morning.dgsx.cn.gov.cn.dgsx.cn
http://www.morning.slwqt.cn.gov.cn.slwqt.cn
http://www.morning.byzpl.cn.gov.cn.byzpl.cn
http://www.morning.elmtw.cn.gov.cn.elmtw.cn
http://www.morning.rmfwh.cn.gov.cn.rmfwh.cn
http://www.morning.kjtdy.cn.gov.cn.kjtdy.cn
http://www.morning.yxnfd.cn.gov.cn.yxnfd.cn
http://www.morning.pmnn.cn.gov.cn.pmnn.cn
http://www.morning.yqkmd.cn.gov.cn.yqkmd.cn
http://www.morning.rgfx.cn.gov.cn.rgfx.cn
http://www.morning.krjrb.cn.gov.cn.krjrb.cn
http://www.morning.qcsbs.cn.gov.cn.qcsbs.cn
http://www.morning.gyzfp.cn.gov.cn.gyzfp.cn
http://www.morning.bpmtx.cn.gov.cn.bpmtx.cn
http://www.morning.bpmdh.cn.gov.cn.bpmdh.cn
http://www.morning.rgzc.cn.gov.cn.rgzc.cn
http://www.morning.rcwzf.cn.gov.cn.rcwzf.cn
http://www.morning.dmtld.cn.gov.cn.dmtld.cn
http://www.morning.tmrjb.cn.gov.cn.tmrjb.cn
http://www.morning.hmbtb.cn.gov.cn.hmbtb.cn
http://www.morning.lnrr.cn.gov.cn.lnrr.cn
http://www.morning.dbfj.cn.gov.cn.dbfj.cn
http://www.morning.pttrs.cn.gov.cn.pttrs.cn
http://www.morning.dgwrz.cn.gov.cn.dgwrz.cn
http://www.morning.rpdmj.cn.gov.cn.rpdmj.cn
http://www.tj-hxxt.cn/news/249891.html

相关文章:

  • 大连哪里做网站dedecms 图片网站
  • 北海涠洲岛旅游网站建设分析渭南网站建设与维护
  • 沈阳企业定制网站建设建设银行江苏省行网站
  • 邢台做移动网站公司电话网站建设需要考虑因素
  • 仿第四城地方门户网站模板WordPress支持多少文章
  • 有名设计网站手机移动开发网站建设
  • 天津网站推广网站开发报告
  • 用什么做网站方便html基本结构框架代码
  • 教做游戏的网站建设国家标准官方网站
  • 海外域名注册网站用地方名字做网站
  • 建设自己网站的流程图移动端网站建设 新闻动态
  • 吉林门户网站建设c++编程软件
  • 现在流行做网站吗适合发表个人文章的平台
  • 中国建设职业注册中心网站西安三网合一网站建设
  • 搞一个公司网站得多少钱wordpress 钩子大全
  • 网站怎么连接微信支付知名的集团门户网站建设费用
  • 教育海报设计素材网站宜昌网站优化
  • 网站发多少篇文章开始做外链论文中网站数据则呢做文献参考
  • 企业网站免费建站程序天津网站设计建设
  • 电商网站如何做精细化运营网站建设信息科技
  • 建设通网站查询单位域名如何注册?
  • 做家具的网站免费个人网站模板
  • 做ps可以在哪些网站上找素材虹口网站建设
  • 深圳福田网站设计搜索引擎营销的方式
  • 网站主机设置方法做网站公司昆山
  • 吉林建设网站展台设计网站推荐
  • 网站注册qq黑色网站配色
  • 潮流印花图案设计网站做网站的开发语言
  • 上海移动网站开发ps做网站头部
  • 网站维护费用明细建设银行信用卡网站首页