To run another activity when button is clicked you just need to add this code in your onClick method:
Intent intent = new Intent(this, AnotherActivity.class);
startActivity(intent);
Hope this helps.
More Related Contents:
- Creating new Android (Java ) file in Existing Android package [closed]
- How to pass an object from one activity to another on Android
- Android – Get real path of a .txt file selected from the file explorer
- Maximum length of Intent putExtra method? (Force close)
- Finish all previous activities
- Sending arrays with Intent.putExtra
- How do you use Intent.FLAG_ACTIVITY_CLEAR_TOP to clear the Activity Stack?
- How to use interface to communicate between two activities
- Prevent Android activity dialog from closing on outside touch
- How do you pass a string from one activity to another? [duplicate]
- Android – Activity Constructor vs onCreate
- How to start Activity in adapter?
- Android Studio cannot resolve symbol but code executes correctly
- Android Unable to instantiate activity: Didn’t find class on path
- android.app.Application cannot be cast to android.app.Activity
- Android Center text on canvas
- How can I start a new android activity using class name in a string?
- How to resume Android Activity programmatically from background
- DeadObjectException on android app
- Android Call a method from another class
- Android: Unable to find explicit activity class… startActivity from a PreferenceActivity
- How to navigate from one screen to another screen
- The activity must be exported or contain an intent-filter
- Android “single top” launch mode and onNewIntent method
- resuming an activity from a notification
- What’s the difference between this and Activity.this
- how to programatically theme an activity to be like a dialog?
- Android: Navigation-Drawer on all activities
- Passing ArrayList of string arrays from one activity to another in android
- Using the camera activity in Android