小编Vig*_*esh的帖子

popupWindow.setOnDismissListener再次触发popupmenu

下面是我的代码,菜单-ImageView menubottom-ImageView我的要求是在显示弹出窗口时显示menubottom图像。

menu.setOnClickListener(new OnClickListener() 
    {   
        public void onClick(View v) 
        {View layout=(View)getLayoutInflater().inflate(R.layout.navigationbar, null);
        popupWindow = new PopupWindow(getApplicationContext());
        popupWindow.setBackgroundDrawable(new BitmapDrawable());
        popupWindow.setContentView(layout);
        popupWindow.setHeight(LayoutParams.WRAP_CONTENT);
        popupWindow.setWidth(swidth);
        popupWindow.setFocusable(false);
        popupWindow.setOutsideTouchable(true);
        popupWindow.setAnimationStyle(-1);

            if(x==1)
            {   popupWindow.showAsDropDown(menubottom);
                menubottom.setVisibility(View.VISIBLE);
                x=0;                    
            }
            else
            {   
                popupWindow.dismiss();
                popupWindow=null;           
            }
            popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {

                @Override
                public void onDismiss() {
                    // TODO Auto-generated method stub
                    menubottom.setVisibility(View.INVISIBLE);   
                    x=1;

                }
            });

        }

}
Run Code Online (Sandbox Code Playgroud)

问题:单击菜单按钮时,将显示弹出窗口,并显示菜单底部。再次按菜单,弹出菜单将被隐藏,然后再次显示。

在弹出菜单外按时,其按预期方式工作(弹出和菜单底部被隐藏)

我认为,setOnDismissListener再次触发menu.setOnClickListener。提前致谢。

android android-layout android-menu android-popupwindow

5
推荐指数
1
解决办法
1938
查看次数

如何在smack 4.1 beta2中创建持久的muc空间

从asmack迁移到smack 4.1 beta2.创建的muc房间不再持久.

MultiUserChatManager mucm=MultiUserChatManager.getInstanceFor(connection);
muc=mucm.getMultiUserChat(groupid+"@conference.localhost");
DiscussionHistory histroy=new DiscussionHistory();
histroy.setMaxStanzas(10);
muc.createOrJoin(username,null,histroy,SmackConfiguration.getDefaultPacketReplyTimeout());
muc.nextMessage();
Run Code Online (Sandbox Code Playgroud)

当用gajim创建时,房间是持久的.

编辑:这是我们之前使用的代码.默认情况下聊天室是持久的,

muc = new MultiUserChat(connection, groupid+"@conference.localhost");

if(!muc.isJoined())
{
DiscussionHistory histroy=new DiscussionHistory();
histroy.setMaxStanzas(10);
muc.join(username,null,histroy,SmackConfiguration.getDefaultPacketReplyTimeout());
muc.nextMessage(0);
}
Run Code Online (Sandbox Code Playgroud)

xmpp ejabberd smack multiuserchat

3
推荐指数
2
解决办法
4608
查看次数

在没有ORDER BY子句的情况下,为什么SQL Server 2000的行为与SQL Server 2008不同?

我们正在使用SQL Server 2008 R2.我们有一个名为PD(6列)的表,它有一个NO主键,没有任何列的索引.当我们执行查询时

select * from PD where ESE='bycad'
Run Code Online (Sandbox Code Playgroud)

如果没有ORDER BY子句,我们每次执行相同的查询时都会以不同的顺序获得结果.我们曾经在两个月前使用SQL Server 2000并且从未遇到过这个问题.

这是SQL Server 2008中的错误吗?我知道我们应该使用ORDER BY子句,但为什么SQL Server 2008在没有ORDER BY子句的情况下处理不同的SQL查询?

sql sql-server-2000 sql-server-2008 sql-server-2008-r2

1
推荐指数
1
解决办法
325
查看次数