android重新启动应用程序和重新启动系统
发布日期:2021-06-30 18:38:55
浏览次数:3
分类:技术文章
本文共 486 字,大约阅读时间需要 1 分钟。
重新启动应用程序,有两种方法,分别是:
1.通过ActivityManager来重新启动应用程序:
ActivityManager manager = (ActivityManager)this.getSystemService(Context.ACTIVITY_SERVICE); manager.restartPackage("com.example.test");2.通过flag来实现:
Intent intent = new Intent(); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(intent);
重新启动系统的方法有:
PowerManager manager = (PowerManager)this.getSystemService(Context.POWER_SERVICE); manager.reboot("重新启动系统");原帖地址:http://blog.csdn.net/faith_boys/article/details/8426414
转载地址:https://linqiarui.blog.csdn.net/article/details/51045092 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
初次前来,多多关照!
[***.217.46.12]2024年04月17日 22时55分49秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
scala maven plugin
2019-04-30
flink 1-个人理解
2019-04-30
redis cli
2019-04-30
redis api
2019-04-30
flink physical partition
2019-04-30
java 解析json
2019-04-30
java http请求
2019-04-30
tensorflow 数据格式
2019-04-30
tf rnn layer
2019-04-30
常用中间件
2019-04-30
tf input layer
2019-04-30
tf model create
2019-04-30
tf dense layer两种创建方式的对比和numpy实现
2019-04-30
tf initializer
2019-04-30
tf 从RNN到BERT
2019-04-30
tf keras SimpleRNN源码解析
2019-04-30
tf keras Dense源码解析
2019-04-30
tf rnn输入输出的维度和权重的维度
2019-04-30
检验是否服从同一分布
2019-04-30
tf callbacks
2019-04-30