intent android open activity
Intent intent = new Intent(this, DisplayMessageActivity.class);
intent.putExtra(key:,value:);
startActivity(intent);
intent android open activity
Intent intent = new Intent(this, DisplayMessageActivity.class);
intent.putExtra(key:,value:);
startActivity(intent);
open a new activity on click of a button
Button btn = (Button)findViewById(R.id.open_activity_button);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(MainActivity.this, MyOtherActivity.class));
}
});
how to move from one activity to another in android studio on button click
private Button button;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main4);
button = (Button)findViewById(R.id.button7);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
openInsideActivity4();
}
});
}
public void openInsideActivity4()
{
Intent intent = new Intent(this,InsideActivity4.class);
startActivity(intent);
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us