2011-03-19 98 views
1

我该怎么做?没有任何.hide()这个,只有.show()?Android隐藏AlertDialog.Builder(mycontext)

我需要7秒

   final Timer timer=new Timer(); 
       timer.schedule(new TimerTask() { 
        @Override public void run() { 
         ad.hide(); //<- this isnt good 
         timer.cancel(); 
        } 
       }, 7000, 0); 

回答

3

Lacas后隐藏alertdialog.builder,

我相信你打算叫dismiss()的对话?

+0

如果(!((DialogInterface)广告)= NULL)((DialogInterface)广告).dismiss();我得到一个Classexception ... :( – lacas 2011-03-19 16:18:27

+0

@lacas你不需要那个投掷 – bigstones 2011-03-19 16:47:01

+0

方法dismiss()是不确定的类型AlertDialog.Builder ... – lacas 2011-03-19 16:55:13

0

AlertDialog.hide();隐藏AlertDialog箱