日本搞逼视频_黄色一级片免费在线观看_色99久久_性明星video另类hd_欧美77_综合在线视频

國內(nèi)最全IT社區(qū)平臺 聯(lián)系我們 | 收藏本站
阿里云優(yōu)惠2
您當(dāng)前位置:首頁 > php開源 > 綜合技術(shù) > Android--頁面跳轉(zhuǎn)

Android--頁面跳轉(zhuǎn)

來源:程序員人生   發(fā)布時間:2015-03-11 08:40:08 閱讀次數(shù):2862次

1.頁面1main.xml代碼以下:

<?xml version="1.0" encoding="utf⑻"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <TextView android:id="@+id/text1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/layout1"/> <Button android:id="@+id/btn1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Go to Layout2" /> </LinearLayout>

頁面2mylayout.xml代碼以下:

<?xml version="1.0" encoding="utf⑻"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <TextView android:id="@+id/text2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/layout2"/> <Button android:id="@+id/btn2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Go to Layout1" /> </LinearLayout>

2.java程序以下:

package org.lxh.demo; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.view.View.OnFocusChangeListener; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; public class Hello extends Activity { private Button btn1 = null; // private Button btn2=null; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // 生命周期方法 super.setContentView(R.layout.main); // 設(shè)置要使用的布局管理器 this.btn1 = (Button) super.findViewById(R.id.btn1); btn1.setOnClickListener(new Button.OnClickListener() { public void onClick(View arg0) { jumpToLayout2(); } }); } public void jumpToLayout2() { setContentView(R.layout.mylayout); Button btn2 = (Button) super.findViewById(R.id.btn2); btn2.setOnClickListener(new Button.OnClickListener() { public void onClick(View arg0) { jumpToLayout1(); } }); } public void jumpToLayout1() { setContentView(R.layout.main); Button btn1 = (Button) super.findViewById(R.id.btn1); btn1.setOnClickListener(new Button.OnClickListener() { public void onClick(View arg0) { jumpToLayout2(); } }); } }

3.運行以下:


生活不易,碼農(nóng)辛苦
如果您覺得本網(wǎng)站對您的學(xué)習(xí)有所幫助,可以手機掃描二維碼進行捐贈
程序員人生
------分隔線----------------------------
分享到:
------分隔線----------------------------
關(guān)閉
程序員人生
主站蜘蛛池模板: 国产视频亚洲 | 黄色大片在线 | 久久亚洲一区二区三区四区 | 久久噜噜噜精品国产亚洲综合 | 欧美a区| 天堂在线中文资源 | 美女福利在线观看 | 国产精品69久久久久水密桃 | 亚洲色图综合 | 国产麻豆一区二区三区在线观看 | 日韩在线免费观看视频 | av日韩久久 | 玖玖精品视频 | 毛片免费在线观看 | av黄色在线| 一级免费视频 | 中文在线免费视频 | 国产欧美日韩综合精品一区二区 | 精品国产一区二区三区四区四 | 福利视频三区 | 免费在线观看av | a级黄色免费看 | 欧美福利一区二区 | av黄色在线观看 | 青青草这里只有精品 | 中文av字幕 | 婷婷精品国产一区二区三区日韩 | 欧美伦理一区二区 | 久久精品一区 | 日日噜噜夜夜狠狠久久av小说 | 黄色高清免费 | 黄免费看 | 国产精品一区二区在线播放 | 国产精品美女久久久 | 国产精选视频在线观看 | 国产成人精品一区 | 亚洲自拍小视频 | 精品视频在线免费观看 | 成人午夜激情 | 免费在线看黄网站 | 免费的av |