AlertDialog "onClick" method not working properly

All we need is a simple explanation of the problem, which is provided below. I currently have an alert dialog that is being displayed on a fragment. The dialog displays to the user with no issues, but the "setPositiveButton" and "setNegativeButton" are not responding to the user interaction correctly, the Log.i after the on "setPositiveButton" … Read more

AlertDialog setItems with a list from room database: getValue() returns null

All we need is a simple explanation of the problem, which is provided below. I’m simply trying to select from a list of Artists in my room database in an AlertDialog. Calling getValue() on the LiveData object from the viewModel consistently gives me null. Do I really need to make a ListAdapter for something this … Read more

How can I make the layout background of AlertDialog transparent?

All we need is a simple explanation of the problem, which is provided below. I’m creating an app in Android Studio. I created an AlertDialog with the background of the layout set to this custom xml: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android:color="@color/connectioncardColor" /> <corners android:bottomRightRadius="8dp" android:bottomLeftRadius="8dp" android:topRightRadius="8dp" android:topLeftRadius="8dp"/> <stroke android:color="@color/colorPrimaryDark" android:width="1dp"/> </shape> The … Read more

How to add a dismiss on a listener argument in a AlertDialog

All we need is a simple explanation of the problem, which is provided below. I’m doing a method to create a custom AlertDialog in which I can call this method passing text, and listener to open a dialog in everywhere. My problem is that when I’m use it, I need to call a dismiss in … Read more

Android Kotlin AlertDialog.Builder() usage and context. "this" not working

All we need is a simple explanation of the problem, which is provided below. This is my very first time using Kotlin/Android App Development, so I apologise if I am missing something simple. I have a background in Java and C#. I’m trying to display an AlertBox containing X information. All the tutorials I am … Read more

Custom dialog not showing properly in other devices

All we need is a simple explanation of the problem, which is provided below. So I am developing one android application in which I have created one custom dialog box. but the problem arises that, this dialog box is showing correct in my phone and on emulator also. But it can’t get display properly on … Read more

Sending Data from Alert Dialog to New Activity

All we need is a simple explanation of the problem, which is provided below. I am new to Android development and I am trying to send data via EditText to TextView from an alert dialog inflated in the MainActivity to a different activity (NewGame.java). I have tried intent.putExtra (see below) however I am getting null … Read more