android,android-listview,expandablelistview
First off, the ExpandableListView supports an easy way to expand the group you need: mGattServicesList.expandGroup(groupPosition); To programmatically click an item is a little tricky. You're on the right track with using the performItemClick() method but you are a little off on how to use it. I will assume you are...
java,android,listview,android-fragments,expandablelistview
You shouldn't pass your view item form a fragment to an other. You should retrieve the object associated with your group view, pass this object to your second/edition fragment. You can use setTargetFragment(...) and onActivityResult(...) to send the modified text from your second to your first fragment. And then you...
Argh ;) found it myself groupList.get(groupPosition) ...
I suggest setting the groupIndicator value to null and instead use a drawable right for your list. In the getGroupView method of your adapter, set the drawable for the view of your list row. getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) with this, you can now say to your...
android,listview,expandablelistview
When a view gets recycled, its components will keep the same visibility state they had previously. So if you hid parts of the View, those will be hidden when it gets recycled. Thus, you need to do two things: Set the View's visibility to the proper state every call of...
java,android,android-activity,expandablelistview
The problem you are having is that you do not have a view in your xml file with the id of "imageViewMap". This causes findViewById(R.id.imageViewMap); to return null and then you are trying to call a function on a null object. I'm not sure which view you are trying to...
android-activity,maps,cluster-computing,expandablelistview,onclicklistener
Solved! After research I make ExpandableAdpater an inner class of MapsActivity! Now i can put data between both classes and use Methods also!
You need to use Class to handle your child data : public class YourData { public String cat_name; public String cat_id; public YourData(String id, String name) { cat_id= id; cat_name = name; } } Now your child list will look like : private List<YourData> _listDataHeader; // header titles You can...
android,android-listview,expandablelistview
Group Indicator in ExpandableListView does not provide the functionality to customize the icon in each item. So the best solution is to set groupIndicator to null, and add an ImageView to the group cell to simulate the effect of a group indicator.
android,expandablelistview,visibility,listitem
Following solution worked for me: public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { if(expListView.getChildAt(firstVisibleItem) != null) { // 1 int top = expListView.getChildAt(firstVisibleItem).getTop(); if(top >= 0) { // 2 if(this.firstVisibleItem != firstVisibleItem) { // 3 if(view != null){ this.firstVisibleItem = firstVisibleItem; } } } } } Make...
android,layout,expandablelistview
<ExpandableListView android:id="@+id/expandable_date" android:layout_width="match_parent" android:layout_height="match_parent" android:groupIndicator="@android:color/transparent" android:layout_weight="5" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:divider="#C0C0C0" android:dividerHeight="1dp" android:background="@android:color/white" /> ...
android,expandablelistview,baseadapter
on your onCreateView initialize the arraylist first as @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { childs = new ArrayList<ProductList>(); ... } ...
android,checkbox,expandablelistview,expandablelistadapter
I haven't gone through your problem but based on the same, I have created a sample project for you, please try with it and i am sure that it will help you to resolve your issue. Expandable Checklist Output:- ...
android,android-listview,expandablelistview,expandablelistadapter
let say, you have some Items as child, and each of them have 5 Strings inside and you want to show them. first , create your child data model : public class ChildModel { String date; String name; String song; String duration; String artist; // constructor and getter setters }...
android,database,sqlite,expandablelistview
Use one MediaPlayer instance! Don't recreate one for each row. You can use its reset() and methods for passing new data source. To pass this new data source in your adapter's getView/bindView (for the row) you can use setTag() method on the view. To avoid creating ambiguity, add an id...
android,android-listview,expandablelistview,expandablelistadapter
You have this result because of android recycling mechanism. To solve this, just change this code: if(groupPosition==0){ container.setVisibility(View.VISIBLE); txtListChild.setVisibility(View.GONE); txtUser.setText(opini.getName()); txtOpini.setText(opini.getContent()); }else{ txtListChild.setText(opini.getText()); txtListChild.setTypeface(null, Typeface.BOLD); } to this: if(groupPosition==0){ container.setVisibility(View.VISIBLE); txtListChild.setVisibility(View.GONE); txtUser.setText(opini.getName());...
android,spinner,expandablelistview
Okay, I am answering my own question, now its working. I just use check and not check images to show sub category is selected or not. Steps: Create a button on toolbar/actionbar, make the UI like spinner. Button btn_filter = (Button)layoutView.findViewById(R.id.filters); btn_filter.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) {...
android,expandablelistview,expandablelistadapter
If your adapter extends BaseExpandableListAdapter, in @Override public View getGroupView(int pos, boolean isExpanded, View v, ViewGroup p) { first, when setting your holder, find your group icon: holder.icon = (ImageView) v.findViewById(R.id.group_icon); and after that: if (isExpanded) { holder.icon.setImageDrawable(context.getResources().getDrawable(R.drawable.ic_1)); } else { holder.icon.setImageDrawable(context.getResources().getDrawable(R.drawable.ic_2)); } ...
By getting the GroupId was able to query the correct row for each child as below @Override protected Cursor getChildrenCursor(Cursor groupCursor) { int groupPos = groupCursor.getPosition(); int groupId = groupCursor.getInt(groupCursor.getColumnIndex("_id")); Log.d("data","Show data groupPos->" + groupPos + "ID->" + groupId); Cursor childCursor = bd.ReadData("select * from images where _id="+groupId); return childCursor;...
android,arrays,multidimensional-array,android-listview,expandablelistview
The code is difficult to follow due to few nested loops and running tasks. Anyway, I suspect the code below is causing your app to save all (unselected) items in the list: for (int i = 0; i < mArrayList.get(groupPosition).getalunos().size(); i++) { Integer Idalunos = mArrayList.get(groupPosition).getalunos().get(i).getId_aluno(); myIdList.add(Idalunos); } Note: Iterating...
android,android-fragments,android-sqlite,expandablelistview,android-cursor
Use the built-in parameterized query syntax. public Cursor getRows(String category){ String where = KEY_CATEGORY + "=?"; Cursor c = myDataBase.query(true, DB_TABLE, ALL_KEYS, where, new String[] { category }, null, null, null, null, null); if (c != null) c.moveToFirst(); return c; } ...
android,android-layout,android-listview,expandablelistview,expand
Implement your own BaseExpandableListAdapter: public class MyExpandableListAdapter extends BaseExpandableListAdapter { ... @Override public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) { LayoutInflater inflater = LayoutInflater.from(mContext); View rowView = inflater.inflate(R.layout.list_group_item, null); return rowView; } ... } list_group_item should contain the desired group indicator image. And don't forget to disable...
i found the answer for my question. for every button click just inflate the xml desiged layout. so the layout can be added one by one. the codes are here LayoutInflater IInflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); String[] names = { "Joe", "Jane", "Herkimer" }; while (run >= 1) { View...
android,scrollview,expandablelistview
The layout_height of the nested LinearLayout is set to match_parent, which causes the nested LinearLayout to be the same height of the parent LinearLayout and hides the ScrollView. It should be something like wrap_content or a fixed size. Also, you don't need a ScrollView. Try something like this: <?xml version="1.0"...
android,expandablelistview,expandablelistadapter
The row views are getting reused by the ListView, which is why the clicks appear to change multiple rows. If you were to wiggle the list a little more, you'd also notice that plus/minus signs are actually random, it doesn't matter which ones were clicked on before. After this line,...
c#,wpf,listbox,expandablelistview,expander
Change the code to this: InterfacesView view = CollectionViewSource.GetDefaultView(Interfaces); view.GroupDescriptions.Add(new PropertyGroupDescription("Name")); view.SortDescriptions.Add(new SortDescription("Name",ListSortDirection.Ascending)); ...
android,listview,imageview,expandablelistview
You are not setting logoNationality visibility back to VISIBLE, as you are doing with nationalityLayout. So I guess once it's gone for the first time, it remains invisible, even if you later reuse the view setting a drawable to it. Have a look to the fixed code: if (player.getNationality() !=...
android,expandablelistview,android-checkbox
Method getChildView(..) is used by adapter to populate the expandable child view under group. I can encourage you to create your own ExpandableListAdapter which extends from BaseExpandableListAdapter (If you have 1 group = 1 item, you can simply use only 1 arrayList with your own POJO object model) And...
android,expandablelistview,expandablelistadapter
This is common problem. Basically this appears due to memory reuse in adding child in the list. You can overcome from this issue just maintain a list in which you stores the position of checked items, in your getView methods check that particular position is stored in list or not,...
android,android-listview,xamarin,monodroid,expandablelistview
Try adding these attributes to xmlhaving ListView android:stackFromBottom="true" android:transcriptMode="alwaysScroll" Or set them programmatically, listView.StackFromBottom = true; listView.TranscriptMode = TranscriptMode.AlwaysScroll; listView.TranscriptMode = TranscriptMode.Normal; ...
android,expandablelistview,expandablelistadapter
The answer is given by the following code: @Override public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) { // Get group and child position -- expandableListView is a reference to an // ExpandableListView widget int groupPos = ExpandableListView.getPackedPositionGroup(expandableListView .getExpandableListPosition(position)); int childPos = ExpandableListView.getPackedPositionChild(expandableListView .getExpandableListPosition(position)); long childId = mCursorAdapter.getChildId(groupPos,...
android,android-listview,expandablelistview
You can try this: holder. Indicator.setImageResource( isExpanded ? android.R.drawable.arrow_up_float : android.R.drawable.arrow_down_float ); ...
android,listview,android-listview,expandablelistview
For me it looks more like a simple LinearLayout in a ScrollView. It will get more complex with the adapters than simply taking some Ids and changing the visibility. You can also use fragments to scope the actions and get every process encapsulated. The animation can be achieved by the...
java,android,gridview,expandablelistview
In My Assumption ExpandListAdapter Class In getChildView() method childPosition does not depends on what country flag is being clicked , Because childPosition here returns the position of the Grid view, not the flags under it So, no need to pass childPosition in constructor of GridView ,since childPosition will always return...
android,expandablelistview,indicator
This worked for me: <?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 android:state_expanded="true" android:drawable="@drawable/arrow_up_black"/> <item android:drawable="@drawable/arrow_down_black"/> </selector> A little more info can be found in this (somewhat) related question....
android,textview,expandablelistview,padding
In order to do this, you can return many view from your adapter. As well, you could define a specific view for every line. Please see my article: http://raverat.github.io/android-listview-multi-views/ Even if this is for a simple ListView, I guess it's the same for an ExpandableListView! ;)...
android,json,expandablelistview
Make new object of child in childArray loop StringRequest stringRequest=new StringRequest(Method.GET, baseUrl+"/dc/Api/Sales/GetOrderPreviewByCustomers?orderNo="+orderno, new Response.Listener<String>() { @Override public void onResponse(String response) { ArrayList<Group> group_list = new ArrayList<Group>(); ArrayList<Child> ch_list; try { jsonArray = new JSONArray(response); for (int i = 0; i < jsonArray.length(); i++) { Group gru = new Group(); ch_list...
you can set a flag in your data set and when you want to remove (hide) that element, set the flag of that element to true and then call notifyDataSetChanged and in your getView method for child, when inflating your view, check for that flag and if it was true...
The reason why you are getting an IndexOutOfBoundsException is because you are trying to get an item at position 50 of your months list in your first if statment while the list had no members. The following code should give you the correct months List and days Hash. (I haven't...
android,expandablelistview,custom-adapter
Did you try changing text color - maybe it is set to white??? The price is showing because android:textColor="@color/dimmed_red"
java,android,arraylist,expandablelistview
All of your arrays are of different sizes but you're iterating over them in the same for loop. Your bold[] has 5 elements, names[] has 10, Images[] only 8; but, you're accessing them in your for loop using the variable j set to iterate 20 times (from 0 to 19)....
android,android-layout,scrollview,relativelayout,expandablelistview
// try this way,hope this will help you... <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <ScrollView android:id="@+id/ScrollView01" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="0.70" android:fillViewport="true" > <RelativeLayout android:layout_width="match_parent"...
Documentation of hasStableIds() Indicates whether the child and group IDs are stable across changes to the underlying data. Returns whether or not the same ID always refers to the same object It's used when you change the data of the Adapter, everytime you change the data the ExpandableListView should update...
Are your groups been shown? If so, have you try clicking on a group? Booomm! java.lang.ClassCastException: android.widget.LinearLayout cannot be cast to <package>.YourActivity$PendientesAdapter$GroupViewHolder I think your problem just comes from this cast so : public View getGroupView(int i, boolean b, View view, ViewGroup viewGroup) { Log.d("pendientesfragment", "getGroupView"); GroupViewHolder holder; if (view...
Assuming not changing your current code more than is required, a correct implementation will be a pretty decent refactor, you can do something like this: @Override public View getChildView(int groupPosition, final int childPosition, boolean isLastChild, View convertView, ViewGroup parent) { LayoutInflater infalInflater = (LayoutInflater) this._context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); if(("IMAGE HEADER").equals(_listDataHeader.get(groupPosition))){ convertView =...
android,listener,expandablelistview
Whats wrong with setting the onClickListener in getChildView()? Button Bt_Name = (Button)convertView.findViewById(R.id.buttonSeeDescription); Bt_Name.setOnClickListener(new OnClickListener( @Override private void Onclick(View view){ Intent intent = new Intent(_context, DestinationActivity.class); _context.startActivity(intent); }); ...
android,android-fragments,expandablelistview,expandablelistadapter
Ok, so here is what was the problem: This was my listrow_rack: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="40dp" android:clickable="true" android:orientation="vertical" android:paddingLeft="40dp" tools:context=".OrdreDetailActivity" > <TextView android:id="@+id/textView1" android:layout_width="wrap_content"...
android,gridview,expandablelistview
I found the solution..i was passing wrong count in getChildrenCountMethod public int getChildrenCount(int groupPosition) { return 1; } Here, i have to pass the number of children for that particular header.And my need is one child per header....
android,android-listview,android-linearlayout,expandablelistview,expandablelistadapter
It looks like the problem is activity_time.xml in the Layout-v17 folder. This is the layout that will be used for API 17 and higher. It looks like in this case it's actually loading this xml instead of the one you expect. Try deleting it or making it the same as...
android,click,parent-child,parent,expandablelistview
Boolean expand1 = true; Boolean expand2 = true; getExpandableListView().setOnGroupClickListener(new OnGroupClickListener() { @Override public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id) { if(groupPosition==0) { fleche =(ImageView)v.findViewById(R.id.pict); expand1=!expand1; if(expand1) fleche.setImageResource(R.drawable.image1); else fleche.setImageResource(R.drawable.image2); } else { fleche =(ImageView)v.findViewById(R.id.pict); expand2=!expand2; if(expand2)...
android,list,expandablelistview,expandablelistadapter
You can find good tutorials for Expandable listview in the following link. http://www.androidhive.info/2013/07/android-expandable-list-view-tutorial/ You can remove unwanted header and child from the String List(based on Admin/User) before give it as input to Expandable list view adapter...
android,expandablelistview,expandablelistadapter,recyclerview
hello i heaved use this adapter for expandable list view use this: public class ExpandableListAdapter extends BaseExpandableListAdapter { private Context _context; private List<String> _listDataHeader; // header titles // child data in format of header title, child title private HashMap<String, List<String>> _listDataChild; private List<Home_property> data; int[] images_tag; public ExpandableListAdapter(Context context, List<Home_property>...
android,height,expandablelistview
Thanks all for answers. The solution is use RelativeLayout instead LinearLayout: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content"> <ImageView android:layout_width="50dp" android:layout_height="50dp" android:id="@+id/noticeImage"/> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_toRightOf="@+id/noticeImage"...
android,android-layout,expandablelistview
Unfortunately I can't completely answer your question. There's a lot going on there and hard to figure out what is what. Also I'm not entirely sure what you are asking. However I will point out that you should not embed the ExpandableListViews within the ScrollView. Having a scrollable widget instead...
android,listview,android-listview,expandablelistview
Its called spinner and Spinners provide a quick way to select one value from a set. In the default state, a spinner shows its currently selected value. refer this link http://developer.android.com/guide/topics/ui/controls/spinner.html...
java,android,textview,expandablelistview
You need to edit your Child class to add one more field say Detail and the getter setter methods for this field.Then set this field in the public ArrayList<Group> SetStandardGroups() You can get the field value in your ExpandListAdapter and then you can set to the second text view. BrandPage...
android,expandablelistview,expandablelistadapter
Be sure to override the isChildSelectable method of your expandable list adapter and return true, like so: public class MyExpandableListAdapter extends BaseExpandableListAdapter { @Override public boolean isChildSelectable(int groupPosition, int childPosition) { return true; } ... } Or android:focusable="false" within the CheckBox section of your expandlist_child_item.xml file. I hope that this...
android,adapter,expandablelistview,expandablelistadapter
You failed to initialize child.bg[] array inside ChildItem class. Change your code as follows: ChildItem child = new ChildItem(); child.title = getString(R.string.WestDescription); child.bg[] = new int[3]; // <----- initiliaze bg[] arrays child.bg[i] = bground[0]; item.items.add(child); ...
android,android-fragments,expandablelistview
I have finally found out how this can be made. I am pasting the code below for anyone who has been encountering the same problem. Feel free to use: public static class LineupFragment extends Fragment { View rootView; ExpandableListView lv; private String[] groups; private String[][] children; public LineupFragment() { }...
java,android,nullpointerexception,expandablelistview,expandablelistadapter
So I'm not too familiar with the LoaderManager but I'd say the onResume() method which restarts the loaders is fishy. I'm thinking you can just remove that completely. I highly suggest reading this SO answer which discusses the difference between initLoader and restartLoader and when to use them when an...
android,multithreading,android-fragments,android-listview,expandablelistview
For everyone, what I have end up doing is to update the dataset after the response from the background job is done and then call notifydatasetchanged. Hope that helps.
android,expandablelistview,drawer
Presumably, your Drawer consists of only the ExpandableListView expListView. If you check the AsyncTask's doInBackground() method, you'll see that error_flag is set to 1 if there's no network available. Then, in the onPostExecute() method: if (error_flag == 1) { expListView.setVisibility(8); A value of 8 corresponds to View.GONE, so, essentially, if...
android,view,expandablelistview,gestures
So here is what's going on: When you set OnGroupClick it is set to the whole listview (not per row) the implementation of the listview will "figure out" which row was clicked when you touch the listView When you set your SwipeListener you attach it to the row. When both...
android,android-listview,expandablelistview,expandablelistadapter
Just return 0 as the children count for those groups: @Override public int getChildrenCount(int groupPosition) { if (groupPosition == 0 || groupPosition == 1) { return 0; } else { // return normal children count } } ...
android,xml,expandablelistview
ExpandableListView has a property called android:listSelector that you can pass a selector, however I couldn't find a state that could be used if the Group is expanded or not. Using android:state_pressed seemed to work when the groupItem is touched, but after releasing it, it's state went back, and the highlight...
android,expandablelistview,android-espresso
There are several points of using adapter views. If it is loading data from adapter you could not use simple view as if Espresso would not wait until data is loaded. If you are going to use Espresso.onData(is(instanceOf(CustomExpandableListAdapter.class))) .inAdapterView(withId(R.id.aversionsListView)) then it its will return AdapterListView. If you want to click...
java,android,gridview,arraylist,expandablelistview
Try calling listView.clearChoices(); and adapter.notifyDataSetChanged(); from the activity or fragment containing the list, not inside the adapter.
I believe you are looking for an AnimatedExpandableListView.
android,checkbox,expandablelistview
class DataAdapter extends BaseExpandableListAdapter { private Context context; LayoutInflater lat = getLayoutInflater(); CheckBox cb; public DataAdapter(Context context) { // TODO Auto-generated constructor stub this.context = context; } @Override public View getChildView(int group, int child, boolean arg2, View v, ViewGroup arg4) { // TODO Auto-generated method stub v = lat.inflate(R.layout.inflate_list, null);...
android,expandablelistview,togglebutton
Ok, it was a very lame error. I had to set the OnTouchListener for the FrameLayout every time getGroupView was called, not only the first time. So the right code of the method is this: public View getGroupView(final int position, boolean isExpanded, View convertView, ViewGroup parent) { GroupHolder holder; if...
Let me answer the second question first, because that is more straightforward. The problem is that when you set you custom click listener, it overrides the default one of the list. So, what you need to do is first check for the child count. If the count is zero, then...
android,view,expandablelistview,expandablelistadapter
The solution to this problem is not an easily apparent one. There is no way to replicate behaviors like ArrayAdapter's capabilities for RecyclerView Adapters. Instead, if you need to get data from a custom view that is not automatically stored, override @Override public void onViewDetachedFromWindow (ViewHolder holder) { //STORE VIEW...
android,checkbox,expandablelistview
Change the dp on the layout_height and layout_width of the checkbox(or really anything else) to get the size you need. For example: <Checkbox android:layout_width="1dp" android:layout_height="1dp" android:id="@+id/checkBox"/> in the item you wish to re-size. Another option is to use custom check boxes, more info here: Android: How to change CheckBox size?...
java,android,json,expandablelistview
I finally found it. I really appreciate the feedback and your help. In the click event for the group, I was not returning true to indicate the click was handled. I was using the click event to toggle the expansion. I don't know why exactly that would cause duplication and...
android,navigation,expandablelistview
activity_main.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#f4f4f4" android:orientation="vertical" > <android.support.v4.widget.DrawerLayout android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" > <FrameLayout android:id="@+id/content_frame" android:layout_width="match_parent" android:layout_height="match_parent" />...
android,android-listview,expandablelistview,listadapter
If I am getting you right, than what you want is something like an ExpandableListview inside another ExpandableListview. The requirement is tricky and solution is bit complicated. Follow the bellow link. It demonstrates the 3-level expandable ListView. http://mylifewithandroid.blogspot.com/2011/02/3-level-expandable-lists.html Mark as right, if this is what you are looking for. :)...
Seems to me that you're fetching the screen's width and using it to set the indicator's bounds. However, your ExpandableListView's width is 320dp. I believe you should calculate the width like this: int width = mExpandableListView.getWidth(); Also all of this should definitely not be called in onWindowFocusChanged, as it can...
android,android-fragments,expandablelistview
Create a member variable in the class of the child element to keep track of the color of it. Then you need your ListAdapter to change the color of the child element based on this new member variable. Now when the button is pressed simply change this color variable and...
android,android-layout,expandablelistview
Is it possible to reuse an ExpandableListView to create views without iterate an array or even create an adapter? You certainly need an ExpandableListAdapter, as that is the way that ExpandableListView knows what the parent Views look like, how many children there are in each parent, and what those...
android,pagination,expandablelistview
I have added(one extra child load more type) as last child in each group of child list. and added condition in getChildView() method to check row is child type or load more type. its working now......
android,xml,android-studio,expandablelistview
After much research on this topic, i could only reach the conclusion that a scrollable object like the expandable listview cant be declared within another scrollable view. However i tweaked around with my java code a little bit for solving this issue during runtime. expListView.setOnGroupExpandListener(new ExpandableListView.OnGroupExpandListener() { @Override public void...
java,android,expandablelistview
Turns out I was never actually adding the childGroup. if (!childData.isEmpty()) childData.add(childGroupCurrent); Turned to: if (!childGroupCurrent.isEmpty()) childData.add(childGroupCurrent); Fixed it....
android,expandablelistview,expandablelistadapter
I solved it by using DrawableRight for group indicators as opposed to using the ExpandableListView's groupindicator.
android,android-actionbar,expandablelistview
Okey, I tried it extending of ActionBarActivity and it works at the moment! I'm going to copy the code here if anybody needs it, I've used a part of code from a how to tutorial. The MainActivity is: public class HomeActivity extends ActionBarActivity { private ArrayList<String> parentItems = new ArrayList<String>();...
android,database,expandablelistview,expandablelistadapter
I got the answer. I created three different ArrayList, one List<String> for header and one HashMap. I populated ArrayList using AsyncTask. Then based on one specific value, I added the values to each ArrayList and added the child arraylist and header arraylist to HashMap as below. JSONObject responseObj = null;...
So it sounds like you have a pretty simple set of data you wish to show the user. And seeing that you need to show 100 or such items, there's not many options when it comes to efficiency for both user and you. ExpandableListView is def a good choice. It'll...
android,android-listview,expandablelistview,expandablelistadapter
At first remove attribute: <ExpandableListView android:listSelector = "@drawable/selector_categorie_item" /> and also remove background selector from ExpandableListView. Then in your child layout item put next attribute: <YourLayout android:background = "@drawable/your_selector" /> Maybe you need the selector like this: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android" > <item android:state_enabled="true" android:state_pressed="true"...
android,android-listview,expandablelistview
use this code activity_main.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:baselineAligned="false" android:orientation="vertical" tools:context="com.example.listtest.MainActivity" > <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent"...
android,expandablelistview,android-4.2-jelly-bean
I solved it with reference to following post int finalHeight, finalWidth; final ImageView iv = (ImageView)findViewById(R.id.scaled_image); final TextView tv = (TextView)findViewById(R.id.size_label); ViewTreeObserver vto = iv.getViewTreeObserver(); vto.addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() { public boolean onPreDraw() { iv.getViewTreeObserver().removeOnPreDrawListener(this); finalHeight = iv.getMeasuredHeight(); finalWidth = iv.getMeasuredWidth(); tv.setText("Height: " + finalHeight + " Width: " + finalWidth); return...
android,expandablelistview,childviews
OK. Besides I am not really sure why this approach won't work I looked again on the posted links to Q/A. I've choosed this one Android - Expandable ListView - using ViewHolder for optimization and followed everything exactly. Now it works that way. I focused to much on my first...