FAQ Database Discussion Community


Android ExpandableListView : set background color of selected item on click

android,android-listview,expandablelistview,expandablelistadapter
I am trying to set a background color for item when the user click on a child item in my expandableListView. Here is the code : expListView.setOnChildClickListener(new OnChildClickListener() { @Override public boolean onChildClick(ExpandableListView parent, View v, final int groupPosition, final int childPosition, long id) { AlertDialog.Builder builder = new AlertDialog.Builder(New_annonce_act_step2.this);...

Null pointer exception while setting image in child view of Expandable list view [closed]

android,adapter,expandablelistview,expandablelistadapter
I am getting a Null Pointer Exception in the line child.bg[i] = bground[0];. I'm trying to set image in ImageView of child item. I have a ImageView and TextView in Child item layout. Here is the code of populating data in Expandable List View. List<GroupItem> items = new ArrayList<GroupItem>(); int[]...

Updating child item in ExpandableListView

android,expandablelistview,expandablelistadapter
I have a shopping cart in the style of an ExpandableListView. I am trying to update the right drawable graphic of a child item. All the child items start out showing a "+" and I want this to change to a "-" when clicked. I tried doing this in the...

Expandable Listview group position text

android,expandablelistview
with Log.e("GroupPosition", String.valueOf(groupPosition)); i can find the id of the Group but how I can Access the text of the group id ...

Add Cluster Items onClick over Expandable List View

android-activity,maps,cluster-computing,expandablelistview,onclicklistener
First of all I'm sorry for my bad English :X Iam quite a newbie in Android App development and Iam about to develope an app which gives the user informations like free park-places in town. The app is based on Google Maps. My Problem: My app starts and shows a...

Android ExpandableListView item images disappear

android,listview,imageview,expandablelistview
I have to display a list of football players in a list. No problem about that, everything works fine but the little flags for the nationality are disappearing while I scroll down my list. Here is what it should look like : list item player OK And here is the...

How to display child items of its respective group item in another listview

android,android-listview,expandablelistview
I want to display the child items of its respective group item available in expandable listview into seperate listview. I have done the following, package com.example.demo_data1; import java.util.ArrayList; import android.annotation.SuppressLint; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.ActionBarDrawerToggle; import android.support.v4.widget.DrawerLayout; import android.support.v4.widget.DrawerLayout.DrawerListener; import android.view.Menu; import...

Populate Expandable Listview from mysql crashes app

android,expandablelistview,baseadapter
I am trying to populate an expandable listview from the database and the app crashes without any log My code: The onCreateView: private View rootView; private ExpandableListView lv; private BaseExpandableListAdapter adapter; private String jsonResult; private String url = "http://reservations.cretantaxiservices.gr/files/getspirits.php"; ProgressDialog pDialog; ArrayList<ProductList> childs; String[] products; ArrayList<ExpandableListParent> customList; @Override public View...

Expandable listview with pagination for each group

android,pagination,expandablelistview
I have to add pagination to each group of expandable list view. I have to load new data for each group separately. I don't want to add common pagination. How can I achieve this?...

different child layout for each Group header in ExpandableListview android

android,expandablelistview
I have used ExpandableListview in which every Group has same child layout. Now there is a situation , in which every Group has different child layout (some has checkbox, some has imageview, some has textview) depending upon its values fetched from web service How do I modify My previous ExpandableListAdapter...

What is this component in Android?

android,listview,android-listview,expandablelistview
I tried to reproduce this component in my app : Is it an expandableListView ? Because I tried to use expandablelistview and I get this result : ...

Put a string into a dialog from a slected list item from a expandable list child

android,dialog,expandablelistview
I've been trying to pull details of an item selected, from my strings.xml. To a dialog pop up when i select an item from my expandable list view (child). Sadly with little success. This is the expandable list fragment from my NavigationDrawerFragment. everything works great. the dialog pulls up with...

How to use expandable list view in the following scenario

android,list,expandablelistview,expandablelistadapter
I am creating an application, which has different screens for admin users and different screens for normal users. When admin logs in, screen will be displayed which consists of expandable list views. The Expandable list view header is a string array. The child items are the list of values obtained...

android Expandablelistview default indicator image

android,android-listview,expandablelistview
I am going to hide indicator of groups using this code in my adapter if ( getChildrenCount( groupPosition ) == 0 ) { holder. Indicator.setVisibility( View.INVISIBLE ); } else { holder. Indicator.setVisibility( View.VISIBLE ); holder. Indicator.setImageResource( isExpanded ? R.drawable.list_group_expanded : R.drawable.list_group_closed ); } But I want to use defult expandable...

The Group Indicator of the expandable List view disappears

android,expandablelistview
I want to change the location of the group Indicator of an expandable List view , from left to right, but the group Indicator disappears . Code From Main Activity: @Override public void onWindowFocusChanged(boolean hasFocus) { super.onWindowFocusChanged(hasFocus); DisplayMetrics dm = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(dm); int width = dm.widthPixels; if(android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.JELLY_BEAN_MR2)...

How to use an ActionBar with an ExpandableListView in the same Activity

android,android-actionbar,expandablelistview
I'm trying to use a ExpandableListView with an ActionBar in the same activity. I don't really know how to use both at the same time because of I can't extend my class to ExplandableListActivity and ActionBarActivity together. Does anybody know how to fix that problem? Thanks!!...

An efficient way to display a lot of items in Android

android,expandablelistview
I would like to know what is the best and most efficient way for both the user and developer(me) to display more than 100 items. Right now I have them all in a ExpandableListView. Every group carry's 11 child items(there are 10 groups). This is not being pulled from any...

Is it possible to use an expandablelistview as a dropdownview for a spinner with multiple select?

android,spinner,expandablelistview
I am using a Button plus an AlertDialog containing an ExpandableListView. Also put a checkbox along with child row, its working fine for single select, but its not waiting for multiple select. When I am using for multiple select, I have to click outside the dialog to terminate the dialog....

ExpandableListView with multiple choice save selected item into an array

android,arrays,multidimensional-array,android-listview,expandablelistview
I have an array that is filled with API data, and I have an expandablelistview to show the items of that array, now what I'm trying to do is when the user clicks on an item it saves th ID of that item into an array, so if the user...

How to select child in ExpandableListView?

android,android-listview,expandablelistview
I already asked the question but with no success. So I'm asking again (sorry btw). I still have this issue : How to access items inside ExpandableListView?. Let me resume. I have this situation in my app : http://img15.hostingpics.net/pics/311437expandablelistview.png I want to make a performClick() on the 2dn item of...

Check if Expandable List first item is displaying

android,expandablelistview,visibility,listitem
I am writing an code, where I need to check if first item for Expandable List is visible. For this I checked with AbsListView.OnScrollListener.onScroll(..firstItem, visibleItemCount..) but it's not working exactly if list get expand. Also is there any way to identify if first item completely visible. Any suggestion here!...

bindChildView and bindGroupView same cursor

android,expandablelistview
using getChildrenCursor how to make bindChildView receive the same cursor as bindGroupView? @Override protected Cursor getChildrenCursor(Cursor groupCursor) { Cursor childCursor = groupCursor;//bd.ReadData("select * from images where _id="+2); return childCursor; } this way returns the Cursor of all groups and not specific to one Group......

OnSwipeListener and ExpandableListView click not recognized

android,view,expandablelistview,gestures
I have a problem recognizing onGroup clicks on my expandable list view. I am using a custom swipe listener for my group views for sliding purposes. Now all I want is to expand groups while pressing on them and it seems I can't find the right way to register both...

Expandable ListView Child return wrong view after scroll down

android,android-listview,expandablelistview,expandablelistadapter
I use Expandable Listview for displaying two group of content and the list is always expand like Picture A. I found a problem, when I run it on my device. When I run, it show just a half of the list like in Picture B, so I scroll down to...

onChildClickListener not working in Expandable List View

android,expandablelistview,expandablelistadapter
I am creating an application, which has an expandable list view I am able to get the expandable list view, but my child click is not working. I am trying to display a toast message on clicking a child in expandable list view. Please help me and let me know...

How to automatically set different item height in ExpandableListView?

android,height,expandablelistview
I'm trying to use ExpandableListView with custom adapter in my project. There is a result view of my activity with ExpandableListView: How you can see, some rows doesn't have a right height and some lines are cropped. What i do wrong? There are my layout files activity layout: <?xml version="1.0"...

ExpandableListView onChildClick doesn't fire (in master/detail flow)

android,android-fragments,expandablelistview,expandablelistadapter
I know a lot have asked similar questions, but none of their solutions works for me. I have a master/detail flow with a expandable list as the list. I can click the groups and expand them, but I can't click the children. I have set them to selectable (at first...

Android ExpandableListview all child item in every group

android,expandablelistview,expandablelistadapter
I create ExpandableListview in Android. I use custom adapter but my all child item is in every single group. Result that I want to : [ First ] [ Second ] [ Third ] - AAA - DDD - GGG - BBB - EEE - HHH - CCC - FFF...

ExpandableListView expandable list not expanding when its height is wrap content, and something is below it

android,xml,android-studio,expandablelistview
Here is my layout code. When i click on the expandable list view it does not expand. However if i increase the height of list it expands. Is there a way to increase the height of list dynamically through code? Can i make it to expand in the middle of...

Expandablelistview custom indicator not visible

android,expandablelistview,indicator
I have a expandablelistview with a custom indicator but somehow the indicator does not get shown in the expandablelistview. Did i perhaps overlooked something? Thank you very much for helping me out. Edit: all works now, below the correct code. custom_arrow.xml: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_empty="true" android:drawable="@drawable/arrow_down_black"/> <item...

recycling view create issues in checkbox state of childview in ExpandablelListview android

android,expandablelistview,expandablelistadapter
In my ExpandableListview, I am using Imageview and Checkbox for childview that resembles the shape image and name. When I tick the checkbox of particular child item , the other child item also gets ticked, after scrolling the checked state changes. I needed multiple values to be selected. public class...

How to pass in a filename from a SQLite database in Android?

android,database,sqlite,expandablelistview
I am having trouble figuring out a solution to my problem. I have an ExpandableListView that creates a new MediaPlayer instance when the child view is clicked. Currently, this is done with a hard coded link to the file in my raw folder, but I want to switch it to...

Android get convertView from BaseExpandableListAdapter

android,view,expandablelistview,expandablelistadapter
I need to call the BaseExpandableListAdapter method @Override public View getChildView(int groupPosition, final int childPosition, boolean isLastChild, View convertView, ViewGroup parent) or something like that to get the view that the method returns. The problem is, if I call that method, I have to pass null to convertView, which will...

Android: Expandable Listview - Load Child content from remote database

android,database,expandablelistview,expandablelistadapter
I have an ExpandableListView with Group headers which wont change. Now I want to bind children of the group with different data from remote database such as MySQL or MSSQL. I have already done this for normal ListView using JSON, I have no idea how to implement it for ExapandableListView....

How to set different group indicator images in expandable list view?

android,android-listview,expandablelistview
What i want is that i am using a expandable list view and i want to set different images for each group indicator. For better understanding i am attaching a snapshot. Any help will be appreciable. ...

GridView inside ExpandableListView with multiple choice on Android

java,android,gridview,expandablelistview
In my app I need to show images inside a expandableListView and it has to be a gridview of images, and these images can be selectable so I have an expandableListAdapter and inside of it I'm implementing a gridview adapter, the images are showing fine as you can see in...

Scroll programmatically to the bottom of an expandablelistview with big content in last item

android,android-listview,xamarin,monodroid,expandablelistview
I'm trying to scroll to the bottom of an expandablelistview programmatically. Every other thread in SO points to either: var groupPosition = listView.ExpandableListAdapter.GroupCount - 1; var childCount = (listView.ExpandableListAdapter as MyAdapter).GetChildrenCount (groupPosition); listView.SetSelectedChild (groupPosition, childCount, false); or: var groupPosition = listView.ExpandableListAdapter.GroupCount - 1; listView.SetSelectedGroup (groupPosition); These work great if your...

expandable list view checkbox smaller

android,checkbox,expandablelistview
Here I have a expandable list view now i put a Checkbox in it in the childs below and my childview grow bigger - why and how can I set it smaller? <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="10dp" android:background="@drawable/mb"> <TextView android:id="@+id/list" android:layout_width="wrap_content" android:layout_height="wrap_content"...

2 different listviews in one expandablelistview

android,listview,android-listview,expandablelistview
I wanted to expand the login when user clicks on login and expand the register when user clicks on the register as shown in image below. I think it should be done with the expandablelistview and two lists. But can't find out how to implement it. I searched a lot...

Expandable listview setselectionfromTop with animation and padding

android,animation,expandablelistview
I enabled animation(expand and contract) to default android'd expandable listview using this https://github.com/idunnololz/AnimatedExpandableListView/blob/master/src/com/idunnololz/widgets/AnimatedExpandableListView.java. However, the one limitation that I am facing is to move the current expanded click to the top. I tried setSelectionFromTop(groupPosition, 0) Here is the question: - How to add animation to bringing it to the top?...

Getting particular view from expandable listview

java,android,listview,android-fragments,expandablelistview
In my list view I have an textview in expandable group and I want to open the dialog when textview is clicked to fill the information through edittext and update textview. Problem: how could I get the groupview textview item in my fragment oncreateview() method....

ExpandableListView groupView checkbox unticking other groupviews

android,checkbox,expandablelistview,expandablelistadapter
I have the following adapter in my Activity. I have set a CheckBox on the GroupView that when touched will check/uncheck the child views (which also have a CheckBox). The state of the CheckBox(true or false) is stored in the DB and initially set to true/checked. The checkboxes are set...

How to get views from onGroupExpanded

android,expandablelistview,expandablelistadapter
I have an expandable listview in my app and I want to do something to a specific group icon once this group is clicked. I've tried overriding onGroupExpanded() but I dont know how to extract the views from it. All I get passed into this method is the group position...

Android ExpandableListView not expanding in Linearlayout

android,android-layout,expandablelistview
I'm working on a layout but i have problems with two ExpandableListView. I've developed my layout using a lot of LinearLayout, it works but the lists doesn't expand because they doesn't heve the space.Now the lists height is to "fill parent" but if i change it to a number like...

Clear all selected items in a gridview

java,android,gridview,arraylist,expandablelistview
I have a gridview inside a ExpandableListView with CHOICE_MODE_MULTIPLE, I'm trying to deselect all items when I press a button, but the way I'm doing it it is only unselecting the last item, how can I clear all of them? @Override public int getCount() { return child.size(); } @Override public...