如何在android中显示组名

时间:2015-02-12 11:25:47

标签: java android

嗨,在下面的代码中,我调用方法imService.DispalyGroupDetails(imService.getUsername());我正在尝试访问的意思是我传递参数imService.getUsername()它将返回基于用户名的用户名我将请求发送到服务器我得到了组名。

我的问题是打印小组详细信息0为什么我得到0我没有得到任何人帮我解决这个问题。

的java

protected void onCreate(Bundle savedInstanceState) 
    {       
        super.onCreate(savedInstanceState);
          if (android.os.Build.VERSION.SDK_INT > 9) {
                StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder()
                .permitAll().build();
                StrictMode.setThreadPolicy(policy);
            }
        setContentView(R.layout.list_screen);

        friendAdapter = new FriendListAdapter(this);



        try {
            imService=Login.imService;
            String groupdetails = imService.DispalyGroupDetails(imService.getUsername());   
            System.out.println(groupdetails);
        } catch (UnsupportedEncodingException e) {

            e.printStackTrace();
        }
    }

的java

public String DispalyGroupDetails(String username) throws UnsupportedEncodingException  {


            String params = 
                        "username="+ URLEncoder.encode(this.username,"UTF-8") + 
                        "&password="+ URLEncoder.encode(this.password,"UTF-8") +
                        "&action="  + URLEncoder.encode("DispalyGroupFDetails","UTF-8")+
                        "&";

            Log.i("PARAMS", params);
            return socketOperator.sendHttpRequest(params);              

    }

0 个答案:

没有答案