• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps LAUNCHING ACTIVITY WITHOUT USE OF BUTTON

Hello there !
I have a question IN ANDROID STUDIO??
What if I want to switch from 1 activity to another and dont want to use button and directly want to go to another activity
Here is the code
else{
// I want to start new activity here
}
 
You can use this code inside your else statement with changing YOURACTIVITY with the name of your other actiivty class

Java:
Intent intent = new Intent(this, YOURACTIVITY.class);
startActivity(intent);
 
Back
Top Bottom