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. Not Able to Browse Internet and Google Map on Emulator

Hi there,

I am trying to use the Google Maps in my app but it just shows the
grey area but no actual maps picture.

Even when i try to open a browser in emulator and try to go to
google.com, it says we page is not available. Its showing two bars of
signal and i think in emulator it means that it has the data
connection.

I have given INTERNET permission in AndroidManifest.xml, added uses-
library 'maps'also. Added the debug certificate key in the layour file
with mapview component.

I am using Android 1.5 with google maps addon api version 3.

Let me know if anyone has the solution to this.

Thanks
Gurpreet Singh

-- 

2. Comments lost in the developer console and market app

Hi,

I don't know why, but some of my app comments lost in the developer console.
I cannot find them....All comments after 2010/12/20 is lost. But it seems
that comments total number is right. Does any body has the same problem? I
also used Market to see my app's comments,  same issue.

Thanks,

Alex

-- 

3. HTC Desire (w/SenseUI) not properly decoding xml chars

4. I'm wanting to start doing a lot with the Android platform, help

5. Remove app widget from picker list

6. Teaser Iklan Tablet Motorola untuk CES 2011

7. (WTSh&WTA) Seputar DHD