Move to other Activity

For Android, page transition means moving Activity.

To move other page, we use intent.

Example) Move from MainActivity to NextActivity

Add Activity data to AndroidManifest.xml


Intent intent = new Intent(MainActivity.this, NextActivity.class);
intent.putExtra("item", "Hi!");
//startActivityForResult(intent, 0);

If you want to add value to NextActivity, use putExtra. It’s key-value style
When backing MainActivity, if you need Result, use startActivityForResult

Receive data from previous Activity

protected void onCreate ( Bundle savedInstanceState )
	Intent intent = getIntent();
	String hello = intent.getStringExtra("item");