Disable a particular row in list view onCreate
by dilu » Wed, 30 Mar 2011 02:21:10 GMT
Sponsored Links
Hi,
I want to disable a particular row in list view based on some
condition on onCreate.
I can disable the row on itemClick.
But I want to disable that particular row onCreate.
Please provide me some piece of coode.I read in this forum that
override the adapter class but I am confused how to do that?
--
Re: Disable a particular row in list view onCreate
by TreKing » Thu, 31 Mar 2011 05:42:32 GMT
There's no reason to do this in onCreate - list view rows are created, if
necessary, when shown. That's when you'd disable it.
Um ... no.
Read the documentation and samples to see how to create custom adapters.
-------------------------------------------------------------------------------------------------
TreKing < http://sites.google.com/site/rezmobileapps/treking> ; - Chicago
transit tracking app for Android-powered devices
--
Sponsored Links
Re: Disable a particular row in list view onCreate
by lbendlin » Thu, 31 Mar 2011 08:21:17 GMT
Think about it from the user's perspective. They see a table row, and they
expect to be able to interact with it. All you'll achieve is frustrating the
users.
--
Re: Disable a particular row in list view onCreate
by dilu » Sat, 02 Apr 2011 12:54:53 GMT
Why do I want to disable?
When list items will get created then I wants to disable a particular
item ,so that user cant interact with that particular row.Conditions I
am checking from the database.Once database will get updated then
again that particular row will become enabled based on some
conditions.But on create I am not able to disable that row.For each
row item I will check the conditions from database.
--
Re: Disable a particular row in list view onCreate
by lbendlin » Sat, 02 Apr 2011 20:32:55 GMT
lists work differently. The process of creating a list cell (and re-using
it) is de-coupled from the process of updating it. The "disabling" needs to
be done in the updating part. So when Android asks you to give it this
particular cell so it can display it you could either try to return null
(that might backfire) or set the cell's height to zero.
Of course you could disable touch events and key events for that cell but as
I said before that is bad UI karma.
--
Re: Disable a particular row in list view onCreate
by dilu » Sat, 02 Apr 2011 21:29:54 GMT
Thanks.But my question is how to do that?
--
Re: Disable a particular row in list view onCreate
by lbendlin » Sat, 02 Apr 2011 23:34:13 GMT
Don't know - by reading the listview documentation maybe?
--
Re: Disable a particular row in list view onCreate
by dilu » Sat, 02 Apr 2011 23:48:42 GMT