android-dialog

Custom number picker inside fragment

谁说胖子不能爱 提交于 2019-12-11 03:52:37
问题 Please, help me with using NumberPicker from https://github.com/SimonVT/android-numberpicker. I have fragment inside which I have button. After clicking button I want to show my number picker (as a pop-up, not new screen). So what I did: I created NumberPickerCustomDialog public class NumberPickerCustomDialog extends DialogFragment { Context context; @Override public Dialog onCreateDialog(Bundle savedInstanceState) { // get context context = getActivity().getApplicationContext(); // make

Want to open downloaded file in appropriate application in Android

…衆ロ難τιáo~ 提交于 2019-12-11 02:48:19
问题 I have to download a document from my server, to my app and save into a private folder. The document can be anything like .doc, .pdf, .docs, .jpg etc. Now, what I want is, after the download is completed, I show an Alert Dialog to open the document. When I click on the pen button then open that particular file in an appropriate application and if the app is not available, then show Dialog to download app. Give me some hint on this. Thanks in advance. 回答1: Try this way: Mails attachment open

AppCompat Dialog Theme with Mis-colored titlebar - Bug?

感情迁移 提交于 2019-12-10 13:07:44
问题 I have a LoginActivity where I use an AppCompat theme like this: <activity android:name=".LoginActivity" android:theme="@style/Theme.AppCompat.Light.Dialog" android:label="Login" /> I am aware that as of this post Google has not yet added Material Themes in AppCompat library for DIALOGS, so I assumed it will fall back on Holo. Instead, this is what I get: Keep in mind, I am not using the AppCompat toolBar . In the Activity , I am not even making a reference to the ActionBar . What you see

MvvmCross Android Dialog bind programmatically

回眸只為那壹抹淺笑 提交于 2019-12-10 09:43:46
问题 I want to use the Android.Dialog ( Cross.UI ) in my MvvmCross project. My first approach was to use AutoViews. As this feature is still fairly young, the alternative was to implement the dialog in touch and Droid platforms. For now i'm just doing this for Droid and I need to programmatically bind the properties of the ViewModel to the elements of the Dialog. My View and ViewModel code is the following: View public class DialogConfigurationView : MvxBindingDialogActivityView

How to use startActivityForResult() through a DialogFragment?

拥有回忆 提交于 2019-12-09 17:33:26
问题 My app requires a username to be added to function properly. The mainActivity displays the username on the top which it retrieves form the database. The mainActivity also has a button which leads to 'addusername' activity through startActivityForResult() method; when the user actually enters a username then only username on the main activity gets refreshed and displayed. There is a submit button on the 'addusername' activity which adds the username and does setResult(RESULT_OK); Everything

How can I close a ProgressDialog after a set time?

你离开我真会死。 提交于 2019-12-09 11:20:46
问题 I am trying to close a ProgressDialog box automatically after 3 seconds. Here is the dialog: ProgressDialog progress = new ProgressDialog(this); progress.setTitle("Connecting"); progress.setMessage("Please wait while we connect to devices..."); progress.show(); I have tried a few methods, but I am unable to get any one of them to work. A simple time or anything would hopefully suffice. Thanks. 回答1: AsyncTask is okay if you are processing a long running task and then want to cancel it after,

Android Error: Unable to add window — token null is not for an application

烈酒焚心 提交于 2019-12-09 07:38:09
问题 Hy. I tried to create an alert dialog but when I run my application, is throw an exception 09-26 12:43:21.949: E/AndroidRuntime(14618): FATAL EXCEPTION: main 09-26 12:43:21.949: E/AndroidRuntime(14618): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application 09-26 12:43:21.949: E/AndroidRuntime(14618): at android.view.ViewRootImpl.setView(ViewRootImpl.java:687) 09-26 12:43:21.949: E/AndroidRuntime(14618): at android.view.WindowManagerImpl

How do I show permissions rationale for multiple permissions request?

不羁的心 提交于 2019-12-09 06:41:26
I am working with Android API 25 and need to make permissions requests in the app. There are a ton of code samples on how to make a request as well as how to show the rationale. This link here shows a simple methodology as do these: Android M Request Multiple permission at a single time , Android M request permission non activity The problem I am having is I am requesting multiple permissions at once (Location, Write storage access, and Contacts) and the ActivityCompatApi23.shouldShowRequestPermissionRationale source code only takes in a String for a single permission and not an array for

show Progress Dialog within a CursorLoader in a fragment android

怎甘沉沦 提交于 2019-12-08 20:51:40
问题 Good day, as the title say, anyone know how to implement a progress dialog while loading data from a CursorLoader within a fragment. can't find any example in this regard. Any link or guide on how to do it will be highly appreciated. Thank you 回答1: I think @Michal's solution would be good for showing an indeterminate ProgressDialog via ProgressDialog#setIndeterminate(true) so I've added a +1. I'm not sure adding a Fragment to a Fragment like this (SomeFragment adding DialogFragment..) is

Changing TimePickerDialog Styles

烂漫一生 提交于 2019-12-08 17:54:25
I want to change the style of my TimePicker but I can't get to change the color of the clock face and the header background. Here's my XML style code - <style name="DateTimeDialog" parent="Theme.AppCompat.Dialog"> <item name="android:colorBackground">@color/colorWhite</item> <item name="android:textColorPrimary">#000000</item> <item name="android:headerBackground">#000000</item> <item name="android:textColorSecondary">#000000</item> <item name="android:button">@color/colorWhite</item> <item name="android:colorPrimaryDark">@color/colorPrimaryDark</item> <item name="android:colorAccent">@color