<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Android SimpleCursorTreeAdapter with CursorLoader for ExpandableListView	</title>
	<atom:link href="https://www.truiton.com/2014/05/android-simplecursortreeadapter-cursorloader-expandablelistview/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.truiton.com/2014/05/android-simplecursortreeadapter-cursorloader-expandablelistview/</link>
	<description>Technology Reaching Us In Time - Online</description>
	<lastBuildDate>Thu, 21 Nov 2019 12:49:40 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>
		By: Michael Chaplin		</title>
		<link>https://www.truiton.com/2014/05/android-simplecursortreeadapter-cursorloader-expandablelistview/#comment-12813</link>

		<dc:creator><![CDATA[Michael Chaplin]]></dc:creator>
		<pubDate>Thu, 09 Mar 2017 05:16:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.truiton.com/?p=602#comment-12813</guid>

					<description><![CDATA[Great tutorial for how to use the SimpleCursorTreeAdapter with CursorLoader, it is exactly what I needed! 

I have one thing that I&#039;ve been struggling to find out still though. How would I go about adding a row under each expanded group view that acts as a header and is the first child view in the list. I have 3 textviews that are populated on each child row so I&#039;m looking to add a title such as Cost($), Date, Name to each child.]]></description>
			<content:encoded><![CDATA[<p>Great tutorial for how to use the SimpleCursorTreeAdapter with CursorLoader, it is exactly what I needed! </p>
<p>I have one thing that I&#8217;ve been struggling to find out still though. How would I go about adding a row under each expanded group view that acts as a header and is the first child view in the list. I have 3 textviews that are populated on each child row so I&#8217;m looking to add a title such as Cost($), Date, Name to each child.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Bruno Pugliese		</title>
		<link>https://www.truiton.com/2014/05/android-simplecursortreeadapter-cursorloader-expandablelistview/#comment-11333</link>

		<dc:creator><![CDATA[Bruno Pugliese]]></dc:creator>
		<pubDate>Sun, 08 Jan 2017 12:12:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.truiton.com/?p=602#comment-11333</guid>

					<description><![CDATA[Thanks a lot for this.

I was looking for an example of expandable list views with loaders and yours was simple and easy to implement.

Saved my day :)]]></description>
			<content:encoded><![CDATA[<p>Thanks a lot for this.</p>
<p>I was looking for an example of expandable list views with loaders and yours was simple and easy to implement.</p>
<p>Saved my day 🙂</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Dimitar		</title>
		<link>https://www.truiton.com/2014/05/android-simplecursortreeadapter-cursorloader-expandablelistview/#comment-11074</link>

		<dc:creator><![CDATA[Dimitar]]></dc:creator>
		<pubDate>Mon, 05 Dec 2016 13:17:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.truiton.com/?p=602#comment-11074</guid>

					<description><![CDATA[I am not sure I got it correctly. Should the reset method look like this:

int groupPos = groupMap.get(id);
mTreeAdapter.setChildrenCursor(groupPos, null);]]></description>
			<content:encoded><![CDATA[<p>I am not sure I got it correctly. Should the reset method look like this:</p>
<p>int groupPos = groupMap.get(id);<br />
mTreeAdapter.setChildrenCursor(groupPos, null);</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Nick		</title>
		<link>https://www.truiton.com/2014/05/android-simplecursortreeadapter-cursorloader-expandablelistview/#comment-6584</link>

		<dc:creator><![CDATA[Nick]]></dc:creator>
		<pubDate>Mon, 16 Feb 2015 13:43:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.truiton.com/?p=602#comment-6584</guid>

					<description><![CDATA[@Javier: I had the same problem like you, and I solved it replacing the type of uri my ContentProvider was setting to notify changes through the ContentResolver. To be more specific in the update method of my ContentProvider I replaced the following statement:

if(rowsUpdated &#062; 0) {	getContext().getContentResolver().notifyChange(uri, null);
}

with this:

if(rowsUpdated &#062; 0) {		getContext().getContentResolver().notifyChange(BgContract.Measurements.CONTENT_URI, null);
}

I hope that will help you!]]></description>
			<content:encoded><![CDATA[<p>@Javier: I had the same problem like you, and I solved it replacing the type of uri my ContentProvider was setting to notify changes through the ContentResolver. To be more specific in the update method of my ContentProvider I replaced the following statement:</p>
<p>if(rowsUpdated &gt; 0) {	getContext().getContentResolver().notifyChange(uri, null);<br />
}</p>
<p>with this:</p>
<p>if(rowsUpdated &gt; 0) {		getContext().getContentResolver().notifyChange(BgContract.Measurements.CONTENT_URI, null);<br />
}</p>
<p>I hope that will help you!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Javier		</title>
		<link>https://www.truiton.com/2014/05/android-simplecursortreeadapter-cursorloader-expandablelistview/#comment-6509</link>

		<dc:creator><![CDATA[Javier]]></dc:creator>
		<pubDate>Wed, 28 Jan 2015 19:06:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.truiton.com/?p=602#comment-6509</guid>

					<description><![CDATA[Hi Mohit,

Thank you very much for this example it&#039;s been really useful for me to understand how ExpandableListView and SimpleCursorTreeAdapter works.

I have used your example in my pet app but instead of using the contacts local provider I&#039;m using one I have developed that provides an interface to a SQLite database. It woks as follows.

The UI thread would follow your example to show a ExpandableListView in a Fragment using two given uris (one for groups, another for childs) in the LoaderCallbacks funcions.

The same UI thread would launch at some point an AsyncTask that in the doInBackground function would query the server and call the insert function of the ContentResolver to modify the underlaying data that is being shown by ExpandableListView. Once the insert has been successful the ContentProvider calls notifyChange with the same uri that was used in the function onCreateLoader. The problem is that the SimpleCursorTreeAdapter seems to be missing the notification and it is not refreshing the data.

Reading your article I got the impression that I could expect the data shown in the UI to be refreshed automatically so I wonder if that is not the case when the notifyChange is being called from the same application (although different thread). do you know if that is the case? is there anything else I might be missing?

thanks in advanced
Javier]]></description>
			<content:encoded><![CDATA[<p>Hi Mohit,</p>
<p>Thank you very much for this example it&#8217;s been really useful for me to understand how ExpandableListView and SimpleCursorTreeAdapter works.</p>
<p>I have used your example in my pet app but instead of using the contacts local provider I&#8217;m using one I have developed that provides an interface to a SQLite database. It woks as follows.</p>
<p>The UI thread would follow your example to show a ExpandableListView in a Fragment using two given uris (one for groups, another for childs) in the LoaderCallbacks funcions.</p>
<p>The same UI thread would launch at some point an AsyncTask that in the doInBackground function would query the server and call the insert function of the ContentResolver to modify the underlaying data that is being shown by ExpandableListView. Once the insert has been successful the ContentProvider calls notifyChange with the same uri that was used in the function onCreateLoader. The problem is that the SimpleCursorTreeAdapter seems to be missing the notification and it is not refreshing the data.</p>
<p>Reading your article I got the impression that I could expect the data shown in the UI to be refreshed automatically so I wonder if that is not the case when the notifyChange is being called from the same application (although different thread). do you know if that is the case? is there anything else I might be missing?</p>
<p>thanks in advanced<br />
Javier</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Mohit Gupt		</title>
		<link>https://www.truiton.com/2014/05/android-simplecursortreeadapter-cursorloader-expandablelistview/#comment-5863</link>

		<dc:creator><![CDATA[Mohit Gupt]]></dc:creator>
		<pubDate>Thu, 13 Nov 2014 17:50:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.truiton.com/?p=602#comment-5863</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.truiton.com/2014/05/android-simplecursortreeadapter-cursorloader-expandablelistview/#comment-5841&quot;&gt;Mark Muhammad&lt;/a&gt;.

Hi Mark,
Thanks for the praise.
Well if you initialize it from a fragment you can call the &lt;code&gt;getActivity()&lt;/code&gt; method in fragment.

Hope this makes sense.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.truiton.com/2014/05/android-simplecursortreeadapter-cursorloader-expandablelistview/#comment-5841">Mark Muhammad</a>.</p>
<p>Hi Mark,<br />
Thanks for the praise.<br />
Well if you initialize it from a fragment you can call the <code>getActivity()</code> method in fragment.</p>
<p>Hope this makes sense.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Mark Muhammad		</title>
		<link>https://www.truiton.com/2014/05/android-simplecursortreeadapter-cursorloader-expandablelistview/#comment-5841</link>

		<dc:creator><![CDATA[Mark Muhammad]]></dc:creator>
		<pubDate>Tue, 11 Nov 2014 01:20:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.truiton.com/?p=602#comment-5841</guid>

					<description><![CDATA[Hi Mohit,
This tutorial has been a big help for me.
Just one question, on line 26 of the adapter, it says
&lt;code&gt;mActivity = (TruitonExpandableListActivity) context;&lt;/code&gt;
What do you think I should do if I have the adapter initialized from a fragment?]]></description>
			<content:encoded><![CDATA[<p>Hi Mohit,<br />
This tutorial has been a big help for me.<br />
Just one question, on line 26 of the adapter, it says<br />
<code>mActivity = (TruitonExpandableListActivity) context;</code><br />
What do you think I should do if I have the adapter initialized from a fragment?</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Minified using Disk

Served from: www.truiton.com @ 2026-07-06 23:04:00 by W3 Total Cache
-->