0

i am a beginner in android app development.

i am trying to display an activity(named MainPage1Activity) by linking it with another activity(named activity_main) when a button is pressed in the MainActivity. i have used intent to link the two but when i run the app in emulator and click the button nothing is displayed. do i have to use a function to use another function to display the other activity???? the code i used in main activity is:

public void viewalarm(View view){
    Intent intent = new Intent(this, MainPage1Activity.class);

}
1
  • you can vote this answer by clicking on arrow key and choose this your best answer and vote it.
    – Habib Zare
    Dec 30, 2012 at 8:35

1 Answer 1

0
Intent intent = new Intent(this, NewActivity.class);
startActivity(intent);

Add your Android Manifest configuration file

<activity android:name="NewActivity"></activity>
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.