效果图:
MainActivity:
import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
findViewById(R.id.startAnotherActivity).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//启动另一个Activity
startActivity(new Intent(MainActivity.this, AnotherActivity.class));
}