android - Create a DialogFragment with a transparent background -


I have searched the answer to this question, but none of the answers help me.

The problem is that I have a DialogFragment, when a user joins a widget (widget as part of config). It looks like:

Enter image details here

dialog Created like this;

Calling activity:

  increases the public class AppWidgetConfigure Activity {Private Zero Set Up () {// Config Widgets Deleted DialogFragment dialog = new ChooserDialog (); dialog.show (getFragmentManager (), "dialog"); }}   

DialogFragment :.

  Public square ChooserDialog extends DialogFragment {@Override Public Dialogs onCreateDialog {bundled savedInstanceState} {options = getResources () getStringArray (R.array.choices); AlertDialog.builder Builder = New AlertDialog.Builder (getActivity ()); builder.setTitle (.getResources () GetString (R.string.widget_dialog_chooser_title)); Builder.Settings (getResources (. GetString (R.string.widget_dialog_chooser_posBtn), this); Builder.setNegativeButton (getResources (). GetString (R.string.widget_dialog_chooser_negBtn), this); Builder .SetSingleChoicesItems (options, -1, this); Return builder.cent (); }}   

I want the dialog to be transparent background Currently, as shown in the picture, there is WidgetConfigure activity as background

Thanks for any help.

Using the code

We can obtain transparent AlertDialog code below < / P>

AlertDialog.Builder builder = new AlertDialog.Builder (getActivity (), android.R.style.Theme_Translucent);

But in your case you have some options to appear in the warning dialogue. In that case, you will have to create a layout with a transparent background with the choice list and set that layout to the dialog.

See something like

  View = getActivity (). GetLayoutInflater (). Inflett (R. Lite Dialogue, Faucet); Builder.setView (see);    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -