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


 oh thanks a lot.




-- 



Other Threads

1. Ponsel Android Bisa Nyalakan Mobil

http://www.detikinet.com/read/2010/07/30/175834/1410482/398/ponsel-android-bisa-nyalakan-mobil

Desire Froyo with HTC sense
Sent by Xemakin Lemoot

-- 
"Indonesian Android Community [id-android]" 

2. UI Widgets/Layout/Tools

Wanted to get feedback from the community on the following:


   - Any tools to quickly assemble and design Android UI ?

   - Any Visual Display/Documentations of all the possible layouts/widgets
   available in the Android Platform ?


Thanks, and appreciate your support.

Kumar    _/|\_
www.saisk.com
ku...@saisk.com
"making a profound difference with knowledge and creativity..."

-- 

3. kamus translate v1.0

4. sinyal xl brmasalah?

5. How to use preference objects in TabActivity

6. Help Needed Getting JSON to Jersey Web Service and Consuming it

7. Gantungan Kunci Android