Intent
来源:互联网 发布:人死后会去哪里知乎 编辑:程序博客网 时间:2024/06/16 09:07
intent Intent
1.Create a new second_layout.xml
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" ><Button android:id="@+id/button_4" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Button 4" /></LinearLayout>
2.create SecondActivity extents Activity
package com.example.activitytest;import android.app.Activity;import android.os.Bundle;import android.view.Window;public class SecondActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.second_layout); }}
3.register for it
<activity android:name=".SecondActivity"> </activity>
因为SecondActivity不是主活动,因此不需要配置标签中的内容.
4. Change the click event in FirstActivity
Intent intent = new Intent(FirstActivity.this,SecondActivity.class); startActivity(intent);
0 0
- intent
- Intent
- Intent
- Intent
- intent
- Intent
- intent
- Intent
- Intent
- Intent
- Intent
- Intent
- Intent
- intent
- Intent
- intent
- Intent
- intent
- 登陆功能:ajax的简单应用
- 优秀程序员的七大特征
- TableLayout详解(实际开发的横线、字体对齐)
- 深入理解java中的package关键字 http://blog.csdn.net/lindir/article/details/8067732
- Android studio中导入github项目详解
- Intent
- 关于org-page的坑
- 【iOS学习笔记 16-2-22】iOS多线程知识总结
- New Moto X怎么查看ip地址
- Eclipse常用快捷键总结
- 学习Runtime类
- Linux软连接与硬连接
- 毕业设计第七天
- BZOJ 1307&1318