How to enable drawer in activity when using custom navigation drawer












1














I have problem when clicking on a drawer it will navigate to an activity.



            if ( (listDataChild.get(listDataHeader.get(groupPosition)).get(childPosition).equals("Fuel"))) {

Intent intent = new Intent(MainActivity.this, Fuel_1.class);
startActivity(intent);


But when it go the activity , i dont see the drawer . I need to press back then it will see the drawer. How to enable the drawer in activity?










share|improve this question
























  • Show a detailed code of how you are doing it.
    – Cool Guy CG
    Nov 13 '18 at 8:34










  • @CoolGuyCG basically i want to display navigation drawer in activity.
    – Muhammad Zawawi
    Nov 13 '18 at 9:20










  • But a lot can still go wrong, so post the code of how you are doing it, then we can see what might be wrong and what needs to be added.
    – Cool Guy CG
    Nov 13 '18 at 9:30










  • Navigation drawers are attached to activities. The problem you are facing is that when you move to this new activity, the navigation drawer is not attached to the new activity but the previous activity, that's why you are not seeing it in the new activity. You may want to use fragments or add the navigation drawer to the new activity
    – sudo_kaizen
    Nov 13 '18 at 10:19










  • @OrimDominic actually I already use fragment and it is working but unfortunately I have a problem with fragment then want to use activity. Can we simply extends the navigation drawer?Because when if we use interface ,i need to add all the method of navigation drawer in the activity and it make the code too long.
    – Muhammad Zawawi
    Nov 13 '18 at 10:22


















1














I have problem when clicking on a drawer it will navigate to an activity.



            if ( (listDataChild.get(listDataHeader.get(groupPosition)).get(childPosition).equals("Fuel"))) {

Intent intent = new Intent(MainActivity.this, Fuel_1.class);
startActivity(intent);


But when it go the activity , i dont see the drawer . I need to press back then it will see the drawer. How to enable the drawer in activity?










share|improve this question
























  • Show a detailed code of how you are doing it.
    – Cool Guy CG
    Nov 13 '18 at 8:34










  • @CoolGuyCG basically i want to display navigation drawer in activity.
    – Muhammad Zawawi
    Nov 13 '18 at 9:20










  • But a lot can still go wrong, so post the code of how you are doing it, then we can see what might be wrong and what needs to be added.
    – Cool Guy CG
    Nov 13 '18 at 9:30










  • Navigation drawers are attached to activities. The problem you are facing is that when you move to this new activity, the navigation drawer is not attached to the new activity but the previous activity, that's why you are not seeing it in the new activity. You may want to use fragments or add the navigation drawer to the new activity
    – sudo_kaizen
    Nov 13 '18 at 10:19










  • @OrimDominic actually I already use fragment and it is working but unfortunately I have a problem with fragment then want to use activity. Can we simply extends the navigation drawer?Because when if we use interface ,i need to add all the method of navigation drawer in the activity and it make the code too long.
    – Muhammad Zawawi
    Nov 13 '18 at 10:22
















1












1








1







I have problem when clicking on a drawer it will navigate to an activity.



            if ( (listDataChild.get(listDataHeader.get(groupPosition)).get(childPosition).equals("Fuel"))) {

Intent intent = new Intent(MainActivity.this, Fuel_1.class);
startActivity(intent);


But when it go the activity , i dont see the drawer . I need to press back then it will see the drawer. How to enable the drawer in activity?










share|improve this question















I have problem when clicking on a drawer it will navigate to an activity.



            if ( (listDataChild.get(listDataHeader.get(groupPosition)).get(childPosition).equals("Fuel"))) {

Intent intent = new Intent(MainActivity.this, Fuel_1.class);
startActivity(intent);


But when it go the activity , i dont see the drawer . I need to press back then it will see the drawer. How to enable the drawer in activity?







android






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 13 '18 at 9:19









Rahul Chandrabhan

1,70241222




1,70241222










asked Nov 13 '18 at 8:31









Muhammad ZawawiMuhammad Zawawi

127




127












  • Show a detailed code of how you are doing it.
    – Cool Guy CG
    Nov 13 '18 at 8:34










  • @CoolGuyCG basically i want to display navigation drawer in activity.
    – Muhammad Zawawi
    Nov 13 '18 at 9:20










  • But a lot can still go wrong, so post the code of how you are doing it, then we can see what might be wrong and what needs to be added.
    – Cool Guy CG
    Nov 13 '18 at 9:30










  • Navigation drawers are attached to activities. The problem you are facing is that when you move to this new activity, the navigation drawer is not attached to the new activity but the previous activity, that's why you are not seeing it in the new activity. You may want to use fragments or add the navigation drawer to the new activity
    – sudo_kaizen
    Nov 13 '18 at 10:19










  • @OrimDominic actually I already use fragment and it is working but unfortunately I have a problem with fragment then want to use activity. Can we simply extends the navigation drawer?Because when if we use interface ,i need to add all the method of navigation drawer in the activity and it make the code too long.
    – Muhammad Zawawi
    Nov 13 '18 at 10:22




















  • Show a detailed code of how you are doing it.
    – Cool Guy CG
    Nov 13 '18 at 8:34










  • @CoolGuyCG basically i want to display navigation drawer in activity.
    – Muhammad Zawawi
    Nov 13 '18 at 9:20










  • But a lot can still go wrong, so post the code of how you are doing it, then we can see what might be wrong and what needs to be added.
    – Cool Guy CG
    Nov 13 '18 at 9:30










  • Navigation drawers are attached to activities. The problem you are facing is that when you move to this new activity, the navigation drawer is not attached to the new activity but the previous activity, that's why you are not seeing it in the new activity. You may want to use fragments or add the navigation drawer to the new activity
    – sudo_kaizen
    Nov 13 '18 at 10:19










  • @OrimDominic actually I already use fragment and it is working but unfortunately I have a problem with fragment then want to use activity. Can we simply extends the navigation drawer?Because when if we use interface ,i need to add all the method of navigation drawer in the activity and it make the code too long.
    – Muhammad Zawawi
    Nov 13 '18 at 10:22


















Show a detailed code of how you are doing it.
– Cool Guy CG
Nov 13 '18 at 8:34




Show a detailed code of how you are doing it.
– Cool Guy CG
Nov 13 '18 at 8:34












@CoolGuyCG basically i want to display navigation drawer in activity.
– Muhammad Zawawi
Nov 13 '18 at 9:20




@CoolGuyCG basically i want to display navigation drawer in activity.
– Muhammad Zawawi
Nov 13 '18 at 9:20












But a lot can still go wrong, so post the code of how you are doing it, then we can see what might be wrong and what needs to be added.
– Cool Guy CG
Nov 13 '18 at 9:30




But a lot can still go wrong, so post the code of how you are doing it, then we can see what might be wrong and what needs to be added.
– Cool Guy CG
Nov 13 '18 at 9:30












Navigation drawers are attached to activities. The problem you are facing is that when you move to this new activity, the navigation drawer is not attached to the new activity but the previous activity, that's why you are not seeing it in the new activity. You may want to use fragments or add the navigation drawer to the new activity
– sudo_kaizen
Nov 13 '18 at 10:19




Navigation drawers are attached to activities. The problem you are facing is that when you move to this new activity, the navigation drawer is not attached to the new activity but the previous activity, that's why you are not seeing it in the new activity. You may want to use fragments or add the navigation drawer to the new activity
– sudo_kaizen
Nov 13 '18 at 10:19












@OrimDominic actually I already use fragment and it is working but unfortunately I have a problem with fragment then want to use activity. Can we simply extends the navigation drawer?Because when if we use interface ,i need to add all the method of navigation drawer in the activity and it make the code too long.
– Muhammad Zawawi
Nov 13 '18 at 10:22






@OrimDominic actually I already use fragment and it is working but unfortunately I have a problem with fragment then want to use activity. Can we simply extends the navigation drawer?Because when if we use interface ,i need to add all the method of navigation drawer in the activity and it make the code too long.
– Muhammad Zawawi
Nov 13 '18 at 10:22














1 Answer
1






active

oldest

votes


















0














I don't fully understand your statement. It is required that if you click on any object in your drawer to take you to an activity specified according to your code. But I guess you want to go to the activity while still displaying your navigation bar? or probably for you to go back to your drawer with a back button from your present activity?. If the latter is the case you can do that in your manifest. just edit your present activity in your manifest like this: <activity
android:name="com.example.myfirstapp.DisplayMessageActivity"
android:label="@string/title_activity_display_message"
android:parentActivityName="com.example.myfirstapp.MainActivity" >

name: this should be the name of your present activity.
label: title of your activity.
parentActivityName: this is your Main Activity. the place you want to go back to when you press the back icon.
I hope you understand this






share|improve this answer





















  • this is what i want to do " t I guess you want to go to the activity while still displaying your navigation bar?"..is it possible?
    – Muhammad Zawawi
    Nov 13 '18 at 9:19












  • While not use fragment instead of activity to solve this problem once and for all
    – taiwo sunday
    Nov 13 '18 at 10:26










  • you can follow an example from here developer.android.com/training/implementing-navigation/…
    – taiwo sunday
    Nov 13 '18 at 10:30










  • above answer by orindiminic is the best for my situation.Anyways thanks for your comment and help.
    – Muhammad Zawawi
    Nov 13 '18 at 16:04











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53276801%2fhow-to-enable-drawer-in-activity-when-using-custom-navigation-drawer%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














I don't fully understand your statement. It is required that if you click on any object in your drawer to take you to an activity specified according to your code. But I guess you want to go to the activity while still displaying your navigation bar? or probably for you to go back to your drawer with a back button from your present activity?. If the latter is the case you can do that in your manifest. just edit your present activity in your manifest like this: <activity
android:name="com.example.myfirstapp.DisplayMessageActivity"
android:label="@string/title_activity_display_message"
android:parentActivityName="com.example.myfirstapp.MainActivity" >

name: this should be the name of your present activity.
label: title of your activity.
parentActivityName: this is your Main Activity. the place you want to go back to when you press the back icon.
I hope you understand this






share|improve this answer





















  • this is what i want to do " t I guess you want to go to the activity while still displaying your navigation bar?"..is it possible?
    – Muhammad Zawawi
    Nov 13 '18 at 9:19












  • While not use fragment instead of activity to solve this problem once and for all
    – taiwo sunday
    Nov 13 '18 at 10:26










  • you can follow an example from here developer.android.com/training/implementing-navigation/…
    – taiwo sunday
    Nov 13 '18 at 10:30










  • above answer by orindiminic is the best for my situation.Anyways thanks for your comment and help.
    – Muhammad Zawawi
    Nov 13 '18 at 16:04
















0














I don't fully understand your statement. It is required that if you click on any object in your drawer to take you to an activity specified according to your code. But I guess you want to go to the activity while still displaying your navigation bar? or probably for you to go back to your drawer with a back button from your present activity?. If the latter is the case you can do that in your manifest. just edit your present activity in your manifest like this: <activity
android:name="com.example.myfirstapp.DisplayMessageActivity"
android:label="@string/title_activity_display_message"
android:parentActivityName="com.example.myfirstapp.MainActivity" >

name: this should be the name of your present activity.
label: title of your activity.
parentActivityName: this is your Main Activity. the place you want to go back to when you press the back icon.
I hope you understand this






share|improve this answer





















  • this is what i want to do " t I guess you want to go to the activity while still displaying your navigation bar?"..is it possible?
    – Muhammad Zawawi
    Nov 13 '18 at 9:19












  • While not use fragment instead of activity to solve this problem once and for all
    – taiwo sunday
    Nov 13 '18 at 10:26










  • you can follow an example from here developer.android.com/training/implementing-navigation/…
    – taiwo sunday
    Nov 13 '18 at 10:30










  • above answer by orindiminic is the best for my situation.Anyways thanks for your comment and help.
    – Muhammad Zawawi
    Nov 13 '18 at 16:04














0












0








0






I don't fully understand your statement. It is required that if you click on any object in your drawer to take you to an activity specified according to your code. But I guess you want to go to the activity while still displaying your navigation bar? or probably for you to go back to your drawer with a back button from your present activity?. If the latter is the case you can do that in your manifest. just edit your present activity in your manifest like this: <activity
android:name="com.example.myfirstapp.DisplayMessageActivity"
android:label="@string/title_activity_display_message"
android:parentActivityName="com.example.myfirstapp.MainActivity" >

name: this should be the name of your present activity.
label: title of your activity.
parentActivityName: this is your Main Activity. the place you want to go back to when you press the back icon.
I hope you understand this






share|improve this answer












I don't fully understand your statement. It is required that if you click on any object in your drawer to take you to an activity specified according to your code. But I guess you want to go to the activity while still displaying your navigation bar? or probably for you to go back to your drawer with a back button from your present activity?. If the latter is the case you can do that in your manifest. just edit your present activity in your manifest like this: <activity
android:name="com.example.myfirstapp.DisplayMessageActivity"
android:label="@string/title_activity_display_message"
android:parentActivityName="com.example.myfirstapp.MainActivity" >

name: this should be the name of your present activity.
label: title of your activity.
parentActivityName: this is your Main Activity. the place you want to go back to when you press the back icon.
I hope you understand this







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 13 '18 at 8:54









taiwo sundaytaiwo sunday

134




134












  • this is what i want to do " t I guess you want to go to the activity while still displaying your navigation bar?"..is it possible?
    – Muhammad Zawawi
    Nov 13 '18 at 9:19












  • While not use fragment instead of activity to solve this problem once and for all
    – taiwo sunday
    Nov 13 '18 at 10:26










  • you can follow an example from here developer.android.com/training/implementing-navigation/…
    – taiwo sunday
    Nov 13 '18 at 10:30










  • above answer by orindiminic is the best for my situation.Anyways thanks for your comment and help.
    – Muhammad Zawawi
    Nov 13 '18 at 16:04


















  • this is what i want to do " t I guess you want to go to the activity while still displaying your navigation bar?"..is it possible?
    – Muhammad Zawawi
    Nov 13 '18 at 9:19












  • While not use fragment instead of activity to solve this problem once and for all
    – taiwo sunday
    Nov 13 '18 at 10:26










  • you can follow an example from here developer.android.com/training/implementing-navigation/…
    – taiwo sunday
    Nov 13 '18 at 10:30










  • above answer by orindiminic is the best for my situation.Anyways thanks for your comment and help.
    – Muhammad Zawawi
    Nov 13 '18 at 16:04
















this is what i want to do " t I guess you want to go to the activity while still displaying your navigation bar?"..is it possible?
– Muhammad Zawawi
Nov 13 '18 at 9:19






this is what i want to do " t I guess you want to go to the activity while still displaying your navigation bar?"..is it possible?
– Muhammad Zawawi
Nov 13 '18 at 9:19














While not use fragment instead of activity to solve this problem once and for all
– taiwo sunday
Nov 13 '18 at 10:26




While not use fragment instead of activity to solve this problem once and for all
– taiwo sunday
Nov 13 '18 at 10:26












you can follow an example from here developer.android.com/training/implementing-navigation/…
– taiwo sunday
Nov 13 '18 at 10:30




you can follow an example from here developer.android.com/training/implementing-navigation/…
– taiwo sunday
Nov 13 '18 at 10:30












above answer by orindiminic is the best for my situation.Anyways thanks for your comment and help.
– Muhammad Zawawi
Nov 13 '18 at 16:04




above answer by orindiminic is the best for my situation.Anyways thanks for your comment and help.
– Muhammad Zawawi
Nov 13 '18 at 16:04


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53276801%2fhow-to-enable-drawer-in-activity-when-using-custom-navigation-drawer%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

List item for chat from Array inside array React Native

Thiostrepton

Caerphilly