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?
1 Answer 1
Use Intent method
Intent intent = new Intent(yourCurrentActivity.this,yourNavigrationDrawerActivityName.class); startActivity(intent); answered May 14, 2016 at 14:30
Vishwesh Jainkuniya
2,84933 gold badges2121 silver badges3636 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
This question is in a collective: a subcommunity defined by tags with relevant content and experts.
- The Overflow Blog
-
- Featured on Meta
-
-
-
Linked
Related
Hot Network Questions
- Is there a difference in military court proceedings that would make it easier to convict the "seditious" congress members?
- Multiple-output flyback converter in DCM mode?
- Selberg's result on primes in short intervals
- Did the Good Thief address Jesus by name in Lk 23:42?
- Why does JavaScript use autoboxing?
- Why is the Gödel numbering taken surjective in Ebbinghaus?
- Not Benny but close
- Difference between VOR approach (with DME required) and VOR DME approach?
- After a "zzzzz" buzz, why black screen & no white power indicator light on 4-year-old Dell P2222H monitor?
- Do customizable blank-slate protagonists limit the narrative potential of action RPGs?
- Does this characterize the product topology?
- A novel where a time traveler arrived by mistake at the peak of the Black Death
- Was the second copy of the FAT ever used for anything?
- Not detained but not free to go
- Testing binary data for statistical independence
- What does Ben Aaronovitch mean by “…large wading bird…” in “Stone and Sky?”
- In places south of the Equator (South America, Africa) their winter is our summer. Why don't they say V'ten tal u'mater l'bracha?
- `InvalidAuthority` error when initializing computation definition on Arcium localnet
- News API in Python
- What does the sentence mean here? I understand each sentence but can't find the logic behind this one in connection with all the others in the passage
- Generating 40kHz, 60kHz, and 77.5kHz square waves with a single MCU's timers
- TikZ word search diagram
- How to neatly align name, Google Scholar metrics (h-index, citations), and profile photo in a CV header?
- Fish-wielding man drowns and his enemy leaves town
default
context.startActivity(new Intent(context, SecondActivity.class));on your button click