标签:super 隐式 显示 bundle imp list implicit ack intent
mainactivity
package com.example.cie.zujiantongxin1; import android.content.Intent; import android.net.Uri; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; public class MainActivity extends AppCompatActivity { Button mButtonExplicit, mButtonimplicit; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mButtonExplicit = (Button)findViewById(R.id.button); mButtonExplicit.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(MainActivity.this, NewActivity.class); startActivity(intent); } }); mButtonimplicit = (Button)findViewById(R.id.button2); mButtonimplicit.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.baidu.com")); startActivity(intent); } }); } }
newActivity
package com.example.cie.zujiantongxin1;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
public class NewActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_new);
}
}
标签:super 隐式 显示 bundle imp list implicit ack intent
原文地址:https://www.cnblogs.com/1915884031A-qqcom/p/9219803.html