October 2012

Snippets, Solutions

Android HttpResponse content(body) to String

Usually I use the following code to convert a Http response content to String:   BufferedReader in = new BufferedReader(new InputStreamReader(response.getEntity().getContent())); StringBuilder responseBuilder = new StringBuilder(); String line = “”; while ((line = in.readLine()) != null) { responseBuilder.append(line); } in.close(); Log.e(“WS RESPONSE”, responseBuilder.toString()); It is not a bad idea but I found over the internet that

, , , ,
Snippets, Solutions

Android ExpandableListView Scroll to Expanded Group Position

Once I had this problem: I had an ExapandableListView with groups and children. When I wanted to expand a group the list was scrolling to the end every time. After a little search I’ve figured it out what the problem was. In my xml file where my ExpandableListView was created, I had this attribute: android:transcriptMode=”alwaysScroll”

, , ,
sponsored
Exit mobile version