Skip to main content

All Questions

Filter by
Sorted by
Tagged with
1 vote
2 answers
672 views

Show red line in switch case statement with menu in android studio

I have faced the error code red line under case R.id.item ( Constant expression required ) to find the id from menu.xml and I have tried to find the problem but I was unable to find it. MainActivity....
M.alsaoud's user avatar
0 votes
1 answer
66 views

How do I add a three dot vertial ellipsis menu with external links to my app in android studio?

I am trying to add a 3 dot vertical menu to my app and all the buttons will lead to external websites, how do I make this happen in android studio? Does anyone know where I should look on how to do ...
Marfog509's user avatar
0 votes
0 answers
30 views

Check textview and get it return as a null

I am working on my java snippet that I want to check if the TextView in the menu is exist or not. If the textview is not exist then I want to return it as a null so I could do something. When I try ...
chris oojer's user avatar
0 votes
1 answer
34 views

How do I get the "custimize the activity" menu back in android studio?

It seems that in older versions of android studio when starting a new project after selecting the activity type there used to be a menu titled "Customize the activity" and I wanted to know ...
user1091091's user avatar
0 votes
0 answers
49 views

How to open a menu with applications programmatically?

I need to open a phone menu with applications programmatically. How can I do it? I know how to open applications in the settings, but what I need is the application menu on the home screen.
Dmitriy's user avatar
  • 455
1 vote
2 answers
844 views

How to set navigationIcon color white in toolbar?

I use toolbar in my application, when I inflate menu in toolbar, navigationIcon color is too dark. I want to set navigationIcon color = white, but I don't know how to do it. Please tell me what can I ...
YouXiang's user avatar
2 votes
2 answers
231 views

Android Studio Menu: Element group is not closed

First of all, I am still a beginner in programming. So Im trying to make a grouped menu but it marks the error "Element group is not closed". It basically demands me to close it after the id,...
Natalio Dominguez's user avatar
0 votes
1 answer
1k views

Custom 3 dots menu not opening when clicking on it Android Studio

So my pop up menu not wants to show when i click on it. I don't get any errors, I think I need to add some more lines of code. I just don't know what? Below you can see the code of my adapter ...
user avatar
-1 votes
1 answer
65 views

How add in Android Studio a popupmenu to application icon on android desktop?

How add in Android Studio a popupmenu to application icon on android desktop? Example popupmenu from apk Chrome
mih's user avatar
  • 81
0 votes
1 answer
238 views

moveable circular menu in android like in screen recorders

I want to create moveable circular menu in android like the ones used in screen recorder apps. Is there any library for it ?
user avatar
0 votes
2 answers
280 views

How to create menuItem dynamically

I have an app which has a menu (3 items) that is obtained from a resource xml menu. The third item in the menu (Insert) should make visible a button and an editable Text box that I have, editText. @...
user11113880's user avatar
0 votes
1 answer
279 views

Menu Items not working when i hit menu items

i am implementing side navigation bar , i`ll create onOptionsItemSelected() method inside method codes are ` public boolean onOptionsItemSelected(@NonNull MenuItem item) { if (toggle....
Ganesh MB's user avatar
  • 1,169
1 vote
1 answer
85 views

Strange behavior when I try to close a searchview

I created a toolbar with a search icon which launches a searchview on clic. However, I tried to add a setOnQueryTextFocusChangeListenerwhen user press back on his phone to close the searchview but the ...
Djanito's user avatar
  • 197
0 votes
0 answers
53 views

Android studio: Activate options menu simultaneously with activity

I have a main fragment. From there, I have a button that redirects to a new activity. In this activity, I have an options menu (on the toolbar). I want that options menu to automatically open with the ...
jrjunior games's user avatar
0 votes
2 answers
128 views

Not able to see App Name in Android application

I am not getting my Application name on the action Bar. So please help me to get the reason why it's hidden and how to solve that. Here is my code: <?xml version="1.0" encoding="utf-8"?> <...
Prajwal MJ's user avatar
1 vote
2 answers
108 views

A Menu hangs on Android Studio

while using Android Studio to develop an Android app , suddenly this menu appears while right clicking on layout design surface and still appearing although I minimized Android Studio window and ...
Shahoud Al-Rai's user avatar
1 vote
1 answer
142 views

How to temporarily block the ability to click a menu item

I have a menu when I click on a specific element of which the activity opens, but the user can quickly click menu iten 2 times, which will lead to the opening of the activity 2 times. How can I block ...
Destroyer's user avatar
  • 795
0 votes
3 answers
183 views

Menu showing but onCreateOptionsMenu() not called

The menu is visible in the Toolbar of the application and I can open it and see the menu items, however the onCreateOptionsMenu() function is not being called, I know this by setting a break point and ...
random1234's user avatar
1 vote
0 answers
67 views

The menu template is incorrectly displayed in Android Studio

I write a program and faced a problem when creating a menu. I even took the menu template, but the meaning remained the same. Below is an example of a template that does not work for me from Android ...
Oleksii Zhurko's user avatar
0 votes
1 answer
476 views

Android Studio not detecting changes

I am new to Android Java programming. Trying to make a simple app. All goes smootly until i want to add a menu... This is how i tried: After that I added the code @Override public boolean ...
user4964200's user avatar
0 votes
0 answers
137 views

Android Studio drawer menu preview issue

I am unable to preview the menu in android studio. I am already adding tools:showIn="navigation_view" to the file but still not working. Screenshot build.gradle : dependencies { ...
Shee Xiong Chen's user avatar
5 votes
2 answers
1k views

ConstraintLayout chain context menu no longer visible in Android Studio

Using Android Studio 3.4 Canary 9 and 10 ConstraintLayout 2.0.0.alpha3 I am having an issue with constraint layout in the bleeding edge build of Android Studio 3.4 canary 9. Basically, when you click ...
Sean Blahovici's user avatar
-1 votes
2 answers
500 views

Handling a menu click event in Android

I am trying to set up a click event for a popup menu in Android. I created an overidden onOptionsItemSelected(), but nothing seems to be happening. Here is the popupmenu.xml file: popupmenu.xml <...
BuffChihuahua's user avatar
0 votes
0 answers
46 views

Main file and menu

Not to repeat the code several times by extending the activities from a basic root file (BaseActivity). I have two menus for activities: one main and one drawer menu. Is it possible to write the java ...
Afol's user avatar
  • 11
1 vote
2 answers
2k views

How to create a navigation menu like this in android studio? [duplicate]

How can I create a navigation menu like this for my app in android studio.
ray1195's user avatar
  • 116
0 votes
3 answers
371 views

I'm creating a Navigation Drawer in android studio and I can not set the clicks on the items

I'm using android studio 3.1.3 I did not find the error, I followed a tutorial but in my case it did not work I searched the source code and found nothing and different follow link: https://github.com/...
Italo Silva's user avatar
1 vote
1 answer
135 views

can't get a reference to menu item

I got my navigation menu and I can't activate a function when an item is being clicked on. I don't get any id on my log console. I have tied using switch and it didn't work. My menu can open perfectly....
Uri Aviv's user avatar
0 votes
1 answer
257 views

I'm trying to implement a menu in android studio

I'm implementing a menu, but it always throws me the same error, I have the same configuration in an earlier app and it works for me in this one, I tried many things and I can not fix it. I tried to ...
julian david's user avatar
0 votes
1 answer
432 views

Android overflow menu nullPointerException when clicking three dots

The normal button works fine, but clicking the three dots button makes an exception @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main_menu, menu); ...
Vincent's user avatar
0 votes
1 answer
92 views

In menu not able to nest items to group widget

neither nesting nor movement of menuItems and groups up and down wrt each other is taking place. Android Studio version - 2.3.1 enter image description here
Vipin's user avatar
  • 67
0 votes
1 answer
689 views

How to Open Menu from Activity w/o toolbar or menu button

I want to open the menu, the problem is my game uses full screen so there is no toolbar, no room for a FAB and no menu button. I have tried to use openOptionsMenu(); in an onClickListener from ...
Roger Belk's user avatar
3 votes
1 answer
499 views

Menu Item icon getting overlapped in API 23

I was creating a cart menu icon with Badge and layler-list but I found that on API 23 the menu icon is getting unwanted background. activity_menu.xml <?xml version="1.0" encoding="utf-8"?> &...
Kuldeep Dubey's user avatar
1 vote
1 answer
216 views

How to get a thinner font in options menu android

I've tried making a option menu in my activity, and I succeed. The problem now, is that the text style is bold, and I don't know how to make it normal. I tried setting textStyle, but it had no effect. ...
Jason's user avatar
  • 1,698
0 votes
0 answers
164 views

Center Pop Up Menu in clicked row of list

I want that my pop up menu appear next to the clicked row. Look at the picture after I click the "..." button: http://postimg.org/image/s35znsaq3/ I added my adapter that init each row. When I click ...
Alex Tech's user avatar
  • 123
1 vote
2 answers
4k views

Android Studio main activity menu missing

menu folder and menu_main.xml is missing from android studio? can anyone help how i can add this to android studio or why its missing and the possible solutions. Please check attached image for ...
Suhail Yaftaly's user avatar
0 votes
3 answers
58 views

Hide optionmenu

I have a option Menu in my toolbar in app.but I want to Is unseen Some places. What solution do you recommend to it my friends? Toolbar toolbar=(Toolbar)findViewById(R.id.toolbar); ...
Reza's user avatar
  • 31
9 votes
4 answers
14k views

There isnt menu folder in android studio project

I am newbie with android and android studio. I am following a book to learn android, I want to create a menu for my activity but in the project structure window, I am unable to find the menu folder ...
riccardo airone's user avatar
0 votes
0 answers
227 views

android share button doesn't work

I've got a DetailsActivity contains simple string , and I tried to share it with share action provider but, the share button appears in the action bar but not woking when clicked. here's my code : ...
Muhammad Mustafa's user avatar
-1 votes
1 answer
140 views

android studio res/menu crash

I'm attempting to create a custom menu bar with a simple button to add a new item to a database. I create the menu folder in the res directory, I create an xml file with the name menu_list.xml Once ...
Philip Mather's user avatar
0 votes
1 answer
1k views

How to add seperate overflow menus for each activity in android

In my android project there are about 10 activities up to now, I want these activities to have separate overflow menus(one overflow menu for each activity with different items in it), is it possible? ...
Kasun Siyambalapitiya's user avatar
0 votes
1 answer
901 views

Android: How to set android.support.design.widget.NavigationView open from right in android studio 1.5.1?

I am using android studio 1.5.1. this version makes navigation drawer activity by its own: <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http:/...
sana's user avatar
  • 3
-1 votes
1 answer
92 views

New activity, same menu

I've build a new activity (.Notitie), tried to put the same menu in it as the main activity (.MainActivity). But it gives a fatal exception:: 01-14 08:24:05.756 12945-12945/nl.verpleegkundigzakboek....
gerwin vis's user avatar
1 vote
2 answers
264 views

Old style Android menu displayed when migrated project to Android Studio

I've migrated my project from Eclipse to Android studio. When I run it I see an old style menu, like in the image. My gradle file is: android { compileSdkVersion 23 buildToolsVersion "23.0....
Costa Mirkin's user avatar
1 vote
0 answers
231 views

Android Studio -- include "Menu option" in "Create Activity"

When I try to make a new Blank Activity in Android Studio, it lets me glance at the screen that would let me include a Menu Resource Name, and then... that disappears and I get one without that option....
geonz's user avatar
  • 304
0 votes
1 answer
4k views

Show menu on button click in android

I just want the normal menu which gets displayed on clicking the settings button in android phone instead with Virtual Button Click. I tried openOptionsMenu(); but it didn't help. I hope you ...
Abhishek Singh's user avatar
2 votes
3 answers
8k views

How do I customize the navigation drawer in Android Studios?

How do I customize the navigation drawer to look like this: I cant find any tutorials to customize the navigation drawer. Can anyone please help?
nachshon f's user avatar
  • 3,660
0 votes
1 answer
707 views

"Show/Hide" menu items in Android Studio

I'm developing an app in Android Studio, and what i am most struggling about is the menu. I didn't want to use master detail flow, neither overflow menu. I ended up using a ListView, and each item of ...
César Pereira's user avatar
1 vote
2 answers
1k views

No menu when running openCV samples (Android Studio)

Running openCV-Android samples does not work as expected. I have Android Studio on Windows, extracted OpenCV-Android 2.4.11 and the sample is tutorial-1-camerapreview (but other samples don't seem to ...
Saiph's user avatar
  • 520
0 votes
1 answer
270 views

how to add menu items to action bar in more than 30 activities

I have created an app in android studio that has more than 30 activities .I created menu items in some activities by adding them in individual menu files and they worked fine . But the problem is ...
ZaidRehman's user avatar
  • 1,731
0 votes
1 answer
81 views

How to create a specific type of menu?

I create this menu https://www.flickr.com/photos/128077707@N03/) and want to use it on an android aplication, I have only create squares and circles imagebuttons and if the red type of menu options ...
Elsanty's user avatar
  • 148