返回系统HOME桌面
来源:互联网 发布:数据库存储图片路径 编辑:程序博客网 时间:2024/06/10 02:40
1、布局文件
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <Button android:id="@+id/home_button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="返回HOME" android:textColor="@android:color/black"/></LinearLayout>
2、MainActivity类
public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button home = (Button)findViewById(R.id.home_button1); home.setOnClickListener(new OnClickListener() {@Overridepublic void onClick(View v) {Intent intent = new Intent();intent.setAction(Intent.ACTION_MAIN);//设置Intent动作intent.addCategory(Intent.CATEGORY_HOME);//设置Intent种类startActivity(intent);//将Intent传递给Activity}}); }}
0 0
- 返回系统HOME桌面
- 返回系统Home桌面
- Android返回Home桌面
- 指定Action、Category调用系统Activity实例-点击按钮,返回Home桌面
- android 模拟home键效果 返回桌面
- 86_返回桌面,Home键
- Android双击Home键返回桌面
- 迅速返回系统桌面
- Fragment Home键返回桌面再打开程序,无法开启
- Intent对象练习1---返回系统桌面
- 在应用程序运行时,按HOME键返回到手机桌面,背景音乐怎样自动关闭
- Android4.3 屏蔽HOME按键返回桌面详解(源码环境下)
- 安卓之关于监听home键返回桌面的总结
- Android4.3 屏蔽HOME按键返回桌面详解(源码环境下)
- android 实现类似于按home键效果直接返回桌面几种方法
- Android4.3 屏蔽HOME按键返回桌面详解(源码环境下)
- android 按home键返回到桌面后,再按桌面应用图标又重新打开该应用的解决方法
- android 按home键返回到桌面后,再按桌面应用图标又重新打开该应用的解决方法
- 说完电调就是螺旋桨了
- 含义while((ch=getchar())!='#'){},while(ch=getchar(),ch!='#'),while(ch=getchar() && ch!='#')
- centos 安装VMwareTools
- 反射(四)使用反射机制调用对象的私有方法及成员变量
- SiourceInght 和 UltraEdit 修改换行符,匹配不同的操作系统
- 返回系统HOME桌面
- 蓝桥杯 最大最小值 (暴力)
- ucgui 窗口管理及回调函数的应用
- fzuOJ 1058 大数吃小数
- 常用正则表达式
- 程序员发展路线
- 《数学之美》马尔科夫链的扩展-贝叶斯网络
- ***LeetCode 42. Trapping Rain Water
- struts2工作原理(转载)