I have an activity that I display to the user as a dialog via a change in the manifest:
android:theme="#android:style/Theme.Holo.Dark.Dialog"
I haven't been able to find any help regarding how to change the divider via this method of calling a dialog - only from typical dialog code.
setDivider doesn't seem to be supported.
Thanks for any help.
Related
I want to show an input dialog exactly like this:
On the android dev page I couldn't find a fitting dialog type? (Alerts, simple dialogs and confirmation dialogs)
I would appreciate it if someone could explain which component this is.
You should use simple Dialog fragment.
Refer following link http://stacktips.com/tutorials/android/android-dialog-fragment-example
I would like the dialog asking for permissions to be full-screen, is it possible ?
try
Dialog dialog=new Dialog(this,android.R.style.Theme_Dark_NoTitleBar_FullScreen)
this will set dialog to show with full screen.
(if I understand your question properly...)
I do not think that we have control over how the Android Manifest Permissions are shown to the user.
As far as I am aware, this is done by the Google Play Store app, and is based only on the permissions declared in the manifest.
You can create custom dialog boxes.
There are answers already available on stackoverflow.
Check this -
How to create a Custom Dialog box in android?
create an activity and set its theme as dialog
I have a dialog with a listview, the first dialog is for selecting an item and the second one is when you edit the dialog. The first one uses a standard dialog box with no custom layout but for the second one I had to use a custom layout to get the picture in place (if anyone knows how I can populate a standard multiple choice dialog with an typed arrayadapter and item template let me know :)). The first dialog looks like standard dialog should look like but how can I get the second one to look the same with white background, lines between the items etc and be sure it always looks like the standard one even when that one is changed.
Standard
(source: filedump.net)
Custom
(source: filedump.net)
/Viktor
For the same, you need to use setMultiChoiceItems while creating dialog. I hope this example helps you: Android Multi selection dialogs
And also check this example: Android: Spinner-Like UI for Selecting Multiple Options
i am looking for ways to change the default color of alert box in android to different color like green or blue. please suggest me ways with exampls
Hi there are you try the following.
1)using setview method of alertdialog to set the view and set the view background as per your choice.
2)you can set the your user defined theme and use it in constructor of your dialog.
3)extend dialog class and in oncreate method decorate your dialog box as per your need.
I just shared the idea with which you can achieve your need.For more info visit the following link.
http://developer.android.com/reference/android/app/AlertDialog.html
cheers...
Is it possible to have an Android Alert box or Dialog off-center? I have tried everything that comes to mind, including making a custom Dialog activity and theme (extending Android:Theme.Dialog), but I have not been able to move it from it's centered position.
Yes you can make the background translucent and fill the entire view, then nest a visible layout within that you can use layout_gravity="top|left" on.
A little off topic, but if you just want to display text, an easier way is to use a toast.
Toast toast = new Toast(new ContextThemeWrapper(getApplicationContext(), R.style.YourDialogStyle));
toast.setGravity(Gravity.LEFT|Gravity.TOP, 0,0);
PopupWindow? An example can be found here: http://www.anddev.org/how_to_create_a_popupwindow-t1259.html