1Button button = (Button) rootView.findViewById(R.id.button1);
2button.setOnClickListener(new View.OnClickListener() {
3 @Override
4 public void onClick(View view) {
5 Intent intent = new Intent(getActivity(), AnotherActivity.class);
6 startActivity(intent);
7 }
8});
1Intent i = new Intent(MainActivity.this, ActivityTwo.class);
2startActivity(i);
1Intent intent = new Intent(MainActivity.this,MainActivity2.class);
2 intent.putExtra("key",value);
3 startActivity(intent);
4////////////////////
5 String string =getIntent().getStringExtra("key");
1Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.vogella.com/"));
2startActivity(i);