android-dialog

Remove black background on custom dialog

断了今生、忘了曾经 提交于 2019-12-03 02:37:00
问题 I want to remove the black background on custom dialog as shown in the picture. I'm sure the black background was from the dialog, not from app's background. ; AlertDialog code public class MyAlertDialog extends AlertDialog { public MyAlertDialog(Context context) { super(context); } public MyAlertDialog(Context context, int theme) { super(context, theme); } } Activity code public void showMyDialogOK(Context context, String s, DialogInterface.OnClickListener OkListener) { MyAlertDialog

Remove black background on custom dialog

99封情书 提交于 2019-12-02 16:11:58
I want to remove the black background on custom dialog as shown in the picture. I'm sure the black background was from the dialog, not from app's background. ; AlertDialog code public class MyAlertDialog extends AlertDialog { public MyAlertDialog(Context context) { super(context); } public MyAlertDialog(Context context, int theme) { super(context, theme); } } Activity code public void showMyDialogOK(Context context, String s, DialogInterface.OnClickListener OkListener) { MyAlertDialog myDialog = new MyAlertDialog(context, R.style.MyDialog2); myDialog.setTitle(null); myDialog.setMessage(s);

android number format exception

情到浓时终转凉″ 提交于 2019-12-02 16:02:14
问题 I get the following exception java.lang.NumberFormatException: Invalid int: "" It is happening when you try to store a value into shared preferences whilst nothing has been inserted into the input field. This is because i am parsing the input as an int (as i need to do a subtraction with the figure) This isn't much of a problem as the app will work however just incase someone using the app wants to be wierd and try and press the save button without entering any data I dont want it to insert.

ProgressDialog circle not showing in device

人走茶凉 提交于 2019-12-02 12:26:54
问题 I have this ProgressDialog in my activity. I'm using a few devices to test but only in one the loading circle is not showing. The device that it's not showing it's a Moto G4 Plus running android 7.0. Below there is a picture. I also run the app in a Asus Zenfone 3 running also android 7.0. They both are running android 7.0 but only one don't show the circle. Here is my code: import android.app.ProgressDialog; private ProgressDialog progressDialog; @Override protected void onCreate(Bundle

android number format exception

本秂侑毒 提交于 2019-12-02 07:59:44
I get the following exception java.lang.NumberFormatException: Invalid int: "" It is happening when you try to store a value into shared preferences whilst nothing has been inserted into the input field. This is because i am parsing the input as an int (as i need to do a subtraction with the figure) This isn't much of a problem as the app will work however just incase someone using the app wants to be wierd and try and press the save button without entering any data I dont want it to insert. I have tried the following: else if (obj ==null || obj.currentWeight.contains("")||obj.targetWeight

android OnkeyListener with filter stop onItemClicklistener from DPAD

半城伤御伤魂 提交于 2019-12-02 02:18:58
This is my custom-dialog layout. I want to move the selector of days and load respective items in the grid below it. I could perform it via filter as said here But because of the filter I am not being able to perform the action that should be triggered while clicking items in the grid view. It works fine when I click via mouse but not D-Pad. If I remove the filter in keyevent, it works normally, but problem again in sliding the selector via. As I am working in STB, I have no option except remote as remote functionality is kept as the basic requirement. Finally solved it by using the filter in

Show dialog activity over another app from background

两盒软妹~` 提交于 2019-12-02 01:39:21
Say you have an app A which opens up another app B (e.g. a map), which is not controlled by you (i.e. it's a preexisting app). So now app A is in the background. Suppose an event occurs and A wants to show a floating dialog over app B's UI (while leaving app B's activity visible behind it). Is this possible? (The usual answer to this would be to display a notification, but this is not a mass market app, and we are trying to get the user's attention very directly.) Currently, I was trying to do something like this: // This code runs in a class other than app A's main activity, // and the

Android M - custom permission dialog style

自古美人都是妖i 提交于 2019-12-01 22:16:11
While implementing the new Android M permission model I noticed that the permissions dialog does not respect the theming of my styles.xml. In my styles.xml I override the dialog and alertdialog style like this: <item name="android:dialogTheme">@style/Theme.dialog</item> <item name="android:alertDialogTheme">@style/Theme.dialog</item> Is it possible to change the theming? Or is it because this is a system dialog like in the device settings? No, it's not possible. The permissions dialog is system dialog , hence you can't change its theme: The M Developer Preview introduces a new app permissions

Using image from street view

坚强是说给别人听的谎言 提交于 2019-12-01 14:09:33
I want to get a picture of streetview (stating latitude and longitude) and display in a dialog, is this possible? I saw some examples here, but not found one that show me how to display the image in dialog. Sorry if already exists this question in the site, but I not found when I search. Yes you can, as a URL root you can use this one http://cbk0.google.com/ or maps.google.com and this is a example where you use above mentioned URL by providing location: http://cbk0.google.com/cbk?output=xml&hl=x-local&ll=34.058593,-118.240673&it=all The result should be: <panorama> <data_properties image

Android dialogs are causing android.view.WindowManager$BadTokenException: Unable to add window

你说的曾经没有我的故事 提交于 2019-12-01 12:55:39
I have putted my activities in childview and now I cannot display dialogs from my activities and adapters. In my logCat i'm getting 04-11 12:39:59.823: E/AndroidRuntime(12831): FATAL EXCEPTION: main 04-11 12:39:59.823: E/AndroidRuntime(12831): android.view.WindowManager$BadTokenException: Unable to add window -- token android.app.LocalActivityManager$LocalActivityRecord@41971f18 is not valid; is your activity running? 04-11 12:39:59.823: E/AndroidRuntime(12831): at android.view.ViewRootImpl.setView(ViewRootImpl.java:513) 04-11 12:39:59.823: E/AndroidRuntime(12831): at android.view