android what is an intent code example
Example 1: intent in fragment android
Button button = (Button) rootView.findViewById(R.id.button1);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(getActivity(), AnotherActivity.class);
startActivity(intent);
}
});
Example 2: intent android
Intent intent = new Intent(MainActivity.this,Activity.class);