Display grouped list view by using Json result in android

This is my JSON response:

{ MyResult: { Apple=[ "iPhone 4S", "iPhone 6" ];Microsoft=[ "Lumia 535", "Lumia 640" ];Samsung=[ "Galaxy A3", "Galaxy A5", "Galaxy A7" ]; } }

I would like to display this above result on Grouped list view(like grouped Table View in iOS).

The three keys of arrays(Apple,Microsoft and Samsung) are headers of the list view and the array items should display under that group.

What should I do?

-------------Problems Reply------------

Try using this


you need to replace ListView with HeaderListView

Use expandable ListView use two array lists as below

List<Map<String, String>> mainList = new ArrayList<Map<String, String>>();
List<List<Map<String, String>>> subList = new ArrayList<List<Map<String, String>>>();

Add values to list. Then create SimpleExpandableListAdapter

Assign this adapter to list and you are done refer to link below for example on it. http://www.edumobile.org/android/android-game-programming/simple-expandable-list-example/

Category:android Views:2 Time:2018-02-11

Related post

  • jquery mobile list view pagination using json result set 2012-02-15

    I am using jquery mobile and phonegap. Here is my json result set getting from server and put into the global variable. var categoriesArr = [ { "Categories": "Bengali Products", "desc": [{"code":"40740","product":"Alphonso Mango Jam 300 Gms","rate":"

  • unable to get values in list view by using simple cursor adapter android? 2011-12-27

    In my android app i want to display the list which is retrieving the values from DB .I m using simple cursor adapter to do so,but list view is empty.Here is my code.my list view have two rows. How can i use simple cursor adapter in app.what i m doing

  • How to correctly display a list of songs using an ArrayAdapter? 2010-04-20

    I am trying to display the list of songs using array adapters. But the problem is i couldnt display the list and only empty screen with preset background is showing up. Here's the code...All the thee are seperate classes... Plz help me... public clas

  • I'm having trouble displaying a horizontal bar chart using a result tree fragment 2012-02-04

    I'm new to XSL, so I'm not sure what I'm doing wrong here. The page is supposed to show election results, with a horizontal bar chart corresponding to the percentage of votes received for each candidate. I'm having trouble displaying a horizontal bar

  • Display DevExpress list view as chart 2012-04-25

    How can I display internal listview or [list view generated from One-To-Many relation] as a chart In other words, If we have a 1-M relation between classes say : Bill and BillCalls, then inside Bill detail view, we have a listview of billcalls, How c

  • Display a list of programs used to create objects that can be added to a word document 2012-07-28

    Original Title: Help Display a list of programs used to create objects that can be added to a word document --------------Solutions------------- Hello priscillarobinson, This thread was created in the Microsoft Answers Site Feedback forum; the Micros

  • How do I display a list of programs used to create objects that can be added to a word document 2014-06-04

    How do I display a list of programs used to create objects that can be added to a word document --------------Solutions------------- I don't fully understand what you are asking. What happens if you right-click on a file (perhaps a text file) and cho

  • How to implement customize list view for multiple screen size in android 2012-03-08

    I have tried customize list view for multiple screen size, but I couldn't achieve that. Can anybody tell me how to implement customize list view for multiple screen size in android? I have used dip in my layout. When I use dip, will it work? I have g

  • Multiple Record Insert in mysql using Json from an android app 2014-04-09

    i want to insert multiple record in MySQL database using Json from My Android app if anyone have idea to insert multiple record in MySQL than tell me. Thanks. That's My Code: String TempDial = ""; Cursor cursord = class1.GetDial(); if (cursord.moveTo

  • how can i display only groups list from facebook using android sdk? 2012-02-21

    please any one guide me how to display only groups list from Facebook account using Facebook sdk. I have search for that particular topic i found some link "https://developers.facebook.com/tools/explorer" i am logged in that link i am seeing only my

  • How to convert a list of anonymous object to string array using linq for return using Json Result in ASP.NET MVC 2010-08-14

    I currently have a list of a book object as follows: public class Book() { public int BookId { get; set; } public string Name { get; set; } public string Author { get; set; } } List<Book> books = BookRepository.SelectAll(); I would like to retu

  • Return a list of values using Json 2012-04-02

    In my controller action, I call a method that returns me a a list of missing files. From here, I return this list to the .js file using Json: foreach (string s in result.Value.MissingImages) { missingImages.Add(s.ToString()); } return Json(new { retu

  • Can't display Sharepoint List view webpart 2010-01-27

    I have a feature that automatically creates some web part pages. I want to display a list in my web part page but I can't get the list to show up. Here is my code in my element.xml file: <Elements xmlns="http://schemas.microsoft.com/sharepoint/"

  • How to add a view for the json result in asp.net mvc? 2010-04-30

    I returned json result from a controller but how can i add a view that uses this json result.. public class MaterialsController : Controller { ConstructionRepository consRepository = new ConstructionRepository(); public JsonResult Index() { var mater

  • How to apply jQuery to a SharePoint grouped list view 2011-08-31

    I'm trying to change the SharePoint list item "Edit" icon to a new image on a SharePoint 2007 site. I've got it working fine by applying some jQuery to the master page. The problem i'm having is, any list view that is configured to be "Grouped", does

  • smiley with text message to be displayed in list view 2011-09-09

    How can i display smiley along with text message in listview. I am developing chat screen.i type message and i need to add smileys along with text. When i press enter button i need to display text and smiley in the above list view where i display lis

  • Efficient way to display the List View in Android 2012-02-13

    I have attached the screen shot of my custom list view. I want to display it efficiently. What is the best possible way to do it? thanks Sneha i have uploaded another list view screen display . But alignment is not proper in it. How to resolve it?? -

  • How to display list view populated from sqlite data in android 2016-06-14

    I am creating an android application that consists of a list view when a button was clicked list view was populated with the data consisting in sqlite. i did some thing below i am not getting any error but it was not showing any retrieved data.Please

  • Setting item height of a list view? (using custom draw) 2010-07-13

    How can I set the row height of a custom drawn list view? Or does it require an owner drawn list view? --------------Solutions------------- It depends on the mode you are using it in. In some modes, you can use the LVM_SETITEMHEIGHT message. In other

  • How to fetch group list from facebook using spring social facebook? 2011-12-03

    I have connected my app with facebook using spring social facebook api. I've tried to fetch all groups using following way FacebookTemplate facebookTemplate = new FacebookTemplate(); List<Group> group = facebookTemplate.fetchConnections("me", "

  • Sorting a list in Python using the result from sorting another list 2012-03-03

    This question already has an answer here: Sorting list based on values from another list? 7 answers I have the two lists in Python list_1 = [5, 2, 8]; list_2 = ['string1', 'string2', 'string3'] I would like to sort the fist list and use the result to

  • Scrolling the list view to the desired result position 2012-04-09

    When I try searching the list view it should scroll to the obtained result instead of filtering the content. For example if I type "De" it should scroll to the first item in the list that matched the Char sequence "De" not filter the items that match

  • Using JSON results as data in JavaScript 2012-04-18

    Basically what I want to accomplish is to use the JSON string, that I'm getting from my WCF Service, as the data for a Kedo Dataviz Chart. My service is working 100% and the JSON string that I'm getting is fine, but consuming it in JavaScript is what

  • Showing a List View when a button is clicked: Android 2010-10-18

    I am trying to implement a drop down list when a button is clicked. So, I have a text view and a button in a navigation bar(nav.xml) and a corresponding list view. This navigation bar is included in another page( products.xml) when the button is clic

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.118 (s). 11 q(s)