Android中的窗口焦点禁用

时间:2013-01-18 07:28:36

标签: android

我陷入困境。我有一个登录表格。我想将它显示为某些用户的禁用状态。我可以得到那些用户,但我不知道如何从窗口中删除焦点。

//to check whether the current user is administrator or not
    public void checkAdministrator(){

        String owner = ParseValues.parsedGroupList.get(indexofGroup).getGroup_owner();
        String currentUser = CCMStaticVariable.loginUserId+"@abc.com";

        if(owner.equalsIgnoreCase(currentUser)){
            administrator=true;
        }
        else{
            administrator=false;
        }
    }

现在 -

if(!administrator){

//here I want to disable the whole Activity, I just want to show the activity in disabled state


}

1 个答案:

答案 0 :(得分:0)

首先从登录xml获取您的父布局并尝试此

parentLayout.setEnabled(false);