ashishbhandari / AndroidTabbedDialog

Android Tabbed Dialog containing fragments
Apache License 2.0
128 stars 37 forks source link

Dismiss Dialog #5

Open MiTHUN24 opened 8 years ago

MiTHUN24 commented 8 years ago

how to dismiss Dialog without using any button is there any method to dismiss dialog please let me know

Datron commented 7 years ago

TabDialogFragment returns DialogFragment type so you could: DialogFragment df = TabDialogFragment.createBuilder(MainActivity.this, getSupportFragmentManager()) .setTitle("hello") .setSubTitle("subtitle") .setTabButtonText(new CharSequence[]{"Tab1", "Tab2"}) .setPositiveButtonText("Love") .setNegativeButtonText("Hate") .setNeutralButtonText("WTF?") .setRequestCode(REQUEST_SIMPLE_DIALOG) .show(); now after the event you are listening to has occurred, simply call df.dismiss(); Make sure that df is global if you want to use it elsewhere in the class.

Canoir commented 6 years ago

DIALOG_EXAMPLE_NAME.dismiss(); // this works on every dialog lib or java default i saw