-1

I am a beginner in Android. I would like to create an App which opens a navigation drawer activity when a button is clicked. I started the project with an empty activity with only a button as my MainActivity. Then I added new navigation drawer activity with all the default codes generated by Android Studio. I tried to search for ways to start the navigation drawer activity when my button in main activity is clicked but I couldn't find any of it. Can anyone help me please?

3
  • 1
    It doesn't matter what kind of activity it is. You just call context.startActivity(new Intent(context, SecondActivity.class)); on your button click Commented May 14, 2016 at 14:28
  • 1
    Come on bro, this is a lame question. Commented May 14, 2016 at 14:31
  • according to google design guidelines you should open your navigation drawer when menu icon in action bar is clicked or it should be fixed. but it is not recommended to open it on button click inside another activity Commented May 14, 2016 at 14:43

1 Answer 1

1

Use Intent method

Intent intent = new Intent(yourCurrentActivity.this,yourNavigrationDrawerActivityName.class); startActivity(intent); 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.