zoukankan      html  css  js  c++  java
  • 一个简单的页面跳转


    代码
    package demo.test;

    import android.app.Activity;
    import android.content.Intent;
    import android.os.Bundle;
    import android.view.View;
    import android.widget.Button;

    public class testmain extends Activity {
        
    /** Called when the activity is first created. */
        @Override
        
    public void onCreate(Bundle savedInstanceState) {
            
    super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
            Button btn
    =(Button)findViewById(R.id.Button01); 
            
            btn.setOnClickListener(
    new  View.OnClickListener() { 
              
    public void onClick(View view) { 
               Intent intent
    =new Intent();
            intent.setClass(testmain.
    this,testchild.class);
            startActivity(intent);
            finish();
              } 
            });
            
            
            
           
        }
    }
    代码
    package demo.test;


    import android.app.Activity;
    import android.content.Intent;
    import android.os.Bundle;
    import android.view.View;
    import android.widget.Button;
    public class testchild extends Activity {
         
    /** Called when the activity is first created. */
        @Override
        
    public void onCreate(Bundle savedInstanceState) {
            
    super.onCreate(savedInstanceState);
            setContentView(R.layout.child2);
       Button btn
    =(Button)findViewById(R.id.Button01); 
            
            btn.setOnClickListener(
    new  View.OnClickListener() { 
              
    public void onClick(View view) { 
               Intent intent
    =new Intent();
            intent.setClass(testchild.
    this,testmain.class);
            startActivity(intent);
            finish();
              } 
            });
        }
    }
    代码
    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package
    ="demo.test"
          android:versionCode
    ="1"
          android:versionName
    ="1.0">
        
    <application android:icon="@drawable/icon" android:label="@string/app_name">
            
    <activity android:name=".testmain"
                      android:label
    ="@string/app_name">
                
    <intent-filter>
                    
    <action android:name="android.intent.action.MAIN" />
                    
    <category android:name="android.intent.category.LAUNCHER" />
                
    </intent-filter>
            
    </activity>
       
    <activity android:name=".testchild"
                      android:label
    ="@string/app_name">
               
            
    </activity>
        
    </application>


    </manifest> 
  • 相关阅读:
    网络安全从入门到精通 (第五章-3) MSSQL反弹注入
    网络安全从入门到精通 (第五章-2) MySQL注入 — Dns 注入
    网络安全从入门到精通 (第五章-1 )Access注入 — Cookie注入&偏移注入
    网络安全从入门到精通 (第四章-3) 注入之全方位利用-盲注
    网络安全从入门到精通(第四章-2)GET&POST&HEAD注入
    网络安全从入门到精通(第四章-1)SQL注入的原理分析&工具的介绍
    Educational Codeforces Round 85 (Rated for Div. 2)(A,B,C,D)
    1.1整除
    POJ
    Graph HDU
  • 原文地址:https://www.cnblogs.com/gwazy/p/1918991.html
Copyright © 2011-2022 走看看