package Ġcom . vin ay ssh eno y . r xd . sample Ċ Ċ import Ġandroid . app . Fragment Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . support . v 7 . app . AppCompatActivity Ċ import Ġandroid . util . Log Ċ import Ġcom . vin ay ssh eno y . r xd . Confirm Dialog Ċ import Ġcom . vin ay ssh eno y . r xd . Rx AlertDialog Ċ Ċ private Ġconst Ġval ĠTAG Ġ= Ġ" MainActivity " Ċ Ċ class ĠMainActivity Ġ: ĠAppCompatActivity () Ġ{ ĊĊ ĉ override Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ Ċĉ ĉ super . onCreate ( savedInstanceState ) Ċĉ ĉ set ContentView ( R . layout . activity _ main ) Ċĉ ĉ if Ġ( savedInstanceState Ġ== Ġnull ) Ġ{ Ċĉĉ ĉ Rx AlertDialog (). show ( Ċĉĉĉĉ ĉ support FragmentManager , Ġ" alert _ dialog ", Ċĉĉĉĉ ĉ Confirm Dialog ( Ċĉĉĉĉĉĉ ĉ " Yes ", Ġnegative Button Ġ= Ġ" Cancel ", Ġtitle Ġ= Ġ" Alert !", Ġmessage Ġ= Ġ" Hello Ġthere !" Ċĉĉĉĉ ĉ ) Ċĉĉ ĉ ) Ċĉ ĉ } Ċ ĉ } ĊĊ ĉ override Ġfun Ġon Attach Fragment ( fragment : ĠFragment ) Ġ{ Ċĉ ĉ super . on Attach Fragment ( fragment ) Ċĉ ĉ Log . d ( TAG , Ġ" Attach Ġfragment Ġwith Ġtag : Ġ${ fragment . tag }") Ċ ĉ } Ċ } Ċ