Android(安卓)添加按钮
16lz
2021-12-04
layout.xml文件
<!-- 添加返回登录界面的按钮 -->
<Button android:id="@+id/back" android:layout_width="wrap_content"android:layout_height="wrap_content" android:text="@string/back"/>
Layout.java文件
Button back = (Button)findViewById(R.id.back);
back.setOnClickListener(this);
@Override //按钮实现事件
public void onClick(View arg0) {
Intent intent = new Intent(SystemSettingAct.this ,LoginActivity.class);
startActivity(intent);
}
更多相关文章
- android文本按钮与输入框
- android布局属性预览
- Android实战技巧之二十二:Android(安卓)5.1 SDK下载与配置
- 安卓布局,比较详细也比较乱
- Android(安卓)Bitmap最全基本操作:与Drawable 、File、btye[]互转
- Android(安卓)程序主菜单 布局
- Android(安卓)清单文件配置防止OOM属性
- Android(安卓)ui
- Android(安卓)xml资源文件中@、@android:type、@*、?、@+含义和区