All Questions
2,341 questions
0
votes
1
answer
31
views
Android Studio Menu Issues
I'm not a developer but I do manage several apps for clients and I came across an issue that my developer doesn't know how to fix...
When I open Android Studio my default menu isn't loading and ...
0
votes
0
answers
21
views
Unable to create menu with toolbar using Viewpager2 (without fragments)
When I try to create the menu via "onCreateOptionsMenu" on my Viewpager2 (without fragments) toolbar, the menu is not being created. I can only see the toolbar without a menu. When I use an ...
0
votes
1
answer
90
views
How to open menu programmatically in Android MAUI App?
I'm building a MAUI app for android devices that have physical keyboard (and want to open menu by using hotkeys). I know how to handle keyboard but I just can't find a way to open menu (3 dots) ...
0
votes
0
answers
120
views
How do I make a navigation drawer open another website link or page?
There are tons of tutorial videos about how to create navigation drawers, but I want to know how to actually make it function. I figured out how to make the navigation menu, but when I click each ...
1
vote
0
answers
18
views
Menu item of NavigationView doesn't get checked if it was the last item checked
I have a menu with a few items, which are displayed or hidden depending on if the user is logged in.
If the user has logged in, I show an item option to sign out. When this happens, I launch the home ...
0
votes
1
answer
37
views
Menu not showing up in activity and also showing some bugs but i didnt get to identify them
this is my mainactivity.kt file
package com.example.everythingcalci
import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
...
0
votes
1
answer
55
views
iconTint in the Toolbar menu in Android
I have a menu:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas....
0
votes
1
answer
212
views
Android MenuProvider adding menu items out of order when resuming activity w/ fragments?
Has anyone seen this? Feels like a bug in the Android MenuProvider.
Activity A has menu items 1 & 2.
Fragment A in Activity A has menu items 3 & 4. Menu items are in order: 1,2,3,4
...
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....
0
votes
1
answer
52
views
Can anyone help? Starting new activity using onOptionsItemSelected with Kotlin
After looking through docs and threads I can't find a solution for my case an am wondering if I could get some help / slight nudge with this. I'm not fully understanding this function and am teaching ...
0
votes
1
answer
1k
views
How to change deprecated onPrepareOptionsMenu
I tried to change code for deprecated menu methods such as setHasOptionsMenu, onPrepareOptionsMenu... used in fragment.
I found maybe similar task link, but I don't know how to change.
Here is current ...
0
votes
2
answers
363
views
action bar not showing in activity
I wrote a simple menu and added it to the action bar but I can't understand why they are not visible in my activity.
I'm using java and android studio, thanks.
Here is my code:
@Override
public ...
-1
votes
1
answer
117
views
How to style drawer menu options in Android Studio - headers for group not stylizing
[Edited 10/5/2023]
I have a drawer menu - swipe the screen from the left and it appears with a list of menu headers each having beneath it 3-5 sub-menu items, each sub-menu item is clickable. I ...
0
votes
0
answers
24
views
I want to create ArcMenu of 180 degree
I want to create menu like semi circle / 180 degree arc as per given image.
Want to create bubble menu like given in image
I tried with "com.sa90.materialarcmenu.ArcMenu" but it giving ...
0
votes
1
answer
15
views
How to detect sub menu click in pop up menu in android?
Facing Click listener issue of Sub Menu of a Pop Up Menu in Android
0
votes
2
answers
424
views
Kotlin Options menu not displaying on
so I've implemented a simple Kotlin program for displaying the options menu and ran it on like every type of emulator, the output does not display the options menu instead it only displays the ...
0
votes
1
answer
2k
views
Android Studio - MenuProvider in MainActivity and also in Fragments?
I migrated from normal menus to MenuProvider so I added in MainActivity:
private void setMenuProvider() {
addMenuProvider(new MenuProvider() {
@Override
public void onCreateMenu(@...
0
votes
0
answers
40
views
Adding a button to the support ActionBar
I currently have this setup for my application in which I have an action bar at the top of the screen with a "hamburger" icon in the top left that shows this navigation drawer.
I now want ...
1
vote
0
answers
24
views
FragmentPagerAdapter keeps not visible fragment menu
I'm using menu provider to create option menu specific by fragment, fragments are managed by viewpager + FragmentPagerAdapter
(requireActivity() as MenuHost).addMenuProvider(
object : ...
0
votes
1
answer
338
views
Flutter swipe on screen to display new page
I am still learning flutter but want to make something a bit more complicated now. I would like to create something like the Draggable Main Apps menu in Android.
While it's possible to use a stack ...
-1
votes
1
answer
113
views
QML: An unexpected spacing
I am trying to create a menu bar in Qt 6.5 and QML. But I faced with problem. Why mainButton Button have a very big space from top of menuHeader Reactangle? I want just attach this Button to bottom of ...
0
votes
1
answer
153
views
Menu resource not found
I started a new project and it's a problem I haven't encountered yet.
It's a simple job that other times worked, create a menu for the toolbar Android Resource Directory -> Resource Type 'menu'. It ...
0
votes
2
answers
377
views
How can I fix my menu on Android studio its not visible in my activity
I have created menu on Res, Directory Res, then menu, inside menu I created dashboard_menu. When I run the menu its not visible. Here is the code on Java.
I tried to change my mini sdk from 23 to 21 ...
3
votes
0
answers
147
views
How can I change color of top & bottom bar in Android Options Menu?
Options menu bars
I have tried everything to try and change or remove them bars. It doesn't go away.
styles.xml:
<resources>
<style name="AppTheme" parent="Theme....
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 ...
0
votes
1
answer
197
views
Android Studio: Chips cannot be clicked after translating them
I created an expandable menu which contains a chip group. When this menu is opened or closed there is an "undo" chip and a "redo" chip that are translated up or down when the menu ...
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 ...
1
vote
1
answer
65
views
Android Toolbar menu SearchView id is not matching inside Fragment
I'm trying to implement searchview on my fragment toolbar. For me other menu item is working properly but using searchview id is not either clicked or listeners invoked to perform searching. I'm ...
0
votes
1
answer
77
views
How to set the colors of an Options Menu
I have an older app that uses openOptionsMenu() and onCreateOptionsMenu() to bring up a menu. Yes, I know this is obsolete, and replacing it with a more modern UI is on my short list of things to do, ...
0
votes
1
answer
41
views
Trouble setting multiple MenuItem Methods when adding to Android Options Menu using Kotlin
I can't seem to figure out how to get my code to set multiple Methods when using Kotlin to programatically add Menu options in Android.
This code works to add a single Method (isCheckable):
...
1
vote
1
answer
857
views
Android: How to change the background of the menu item in the toolbar
You need to change the background of the ~showAsAction = always element as in the example.
I tried to make custom xml through a layer-list with a background and an icon, but as a result, the ...
0
votes
0
answers
39
views
How to access ActivityMainBinding file from fragment
I MainActivity where I have bottom navigation tabs. And I have a fragment where I need to have access to the ActivityMainBinding file to change the state of the bottom tab.
Could you please show me ...
0
votes
1
answer
505
views
PopUp button showing on bottom Kotlin
i am making a popup menu on a fragment, the problem is when i show the popup menu that it shows on the bottom of the screen and I want it to show on the right high corner, does anyone know how to ...
0
votes
2
answers
123
views
Add/Remove menuItem not working in onPrepareOptionsMenu function
enter image description hereI am a beginner and i am trying to add and remove menuItem dynamically.
Here is my MainActivity.kt
I have two popups where in one popup i am asking for first name, last ...
0
votes
0
answers
19
views
Transfer menu bar to other activities
I've been struggling with this problem for hours and can't get any further. I have an app that I want to add Bluetooth to. If you press a button, the smartphone should search for Bluetooth devices. It ...
5
votes
1
answer
1k
views
Remove elevation from dropdown in Jetpack Compose
I need remove the elevation/shadow from dropdown menu, like right image:
My menu:
DropdownMenu(
expanded = mExpanded,
onDismissRequest = { mExpanded = false },
modifier = ...
1
vote
1
answer
78
views
Drawer Navigation menu click listener is not working How to solve this?
Drawer Navigation works normally, but when an item is clicked, no event is generated and Navigation is terminated. Which event listener should I use?
I want to use the Drawer Navigation by clicking on ...
1
vote
1
answer
364
views
How to load image via URL into BottomNavigationView menu item icon
I followed this answer, But it showed up like this
and this is my code
String imageUrl = "https://m.media-amazon.com/images/M/...
0
votes
1
answer
162
views
onOptionsItemSelected(@NonNull MenuItem item) item ids are not matching what is in my xml of the menu
I have a navigation menu in my HomeActivity extends AppCompatActivity
The drawer opens and closes and the menu items show up but when I click an item eg logout
The ids inside this code do not match ...
2
votes
3
answers
3k
views
How to add items to the menu bar using the new MenuProvider?
Very much a beginner question here. Since the old paradigm which used "setHasOptionsMenu(true)" in the fragments was recently deprecated in Android Studio, I have been trying to convert my ...
0
votes
0
answers
69
views
Android drawable menu options are not clickable
I want to create a drawable menu for my android app, currently using Java. I followed this tutorial: https://www.geeksforgeeks.org/navigation-drawer-in-android/
Mainactivity.java
...
public ...
0
votes
2
answers
1k
views
MenuProviders are not switched automatically inside a ViewPager
I have a ViewPager with 2 Fragments. Each Fragment holds a MenuProvider which is added as follows:
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
...
1
vote
1
answer
59
views
Unable to navigate items on menu drawer
I am trying to navigate different activity using menu drawer but nothing happens after clicking on any item of the menu drawer. It would be great if anyone could help me in finding out what I am ...
0
votes
0
answers
53
views
Change the color of the icon that opens the navigation bar, located in the toolbar
I am trying to change only the color of the icon that opens the navigation drawer. I have tried using a few solutions found on here like IconTint and the one current in my themes.xml file. The tint ...
0
votes
1
answer
476
views
Not sure how to target menu items
this is probably a simple question for most of you but I'm just wondering if any of you could tell me what exactly MenuItem item is targeting when working with toolbars? I'm taking a class on Android ...
3
votes
1
answer
1k
views
Material toolbar menu background padding and color
I migrated by app to Material design 1.5.0. I use following code for toolbar (simplified):
Inside Activity:
<include layout="@layout/toolbar_default" />
toolbar_default:
<?xml ...
1
vote
0
answers
38
views
SharedPreferences. how do I make sure that the account remains the same?
I have already created users, a name and password in my database. Then the user name is passed to the next activity. And with the next activity from the menu, you can click the logout button and it ...
1
vote
1
answer
539
views
NullPointerException: Attempt to invoke virtual method 'int android.view.ViewGroup.getPaddingBottom()' on a null object reference
Crashing when I am trying to inflate menu to BottomNavigationView but got crash on same. I have updated material design library from 'com.google.android.material:material:1.2.1' to 'com.google.android....
0
votes
2
answers
93
views
Navigation Drawer item Click not Works.followed Questions
I have used navigation drawer in the code.When clicking items noting happens.Tried various things from Stackoverflow and net.
import android.os.Bundle;
import android.view.MenuItem;
import android....
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 ...