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. HDPI-device using mdpi resources

Hi all...

I'm developing an app and frequently testing on a device, rather than
emulator.
It's so very quick to build and launch, I love it.

Now that the layout is becoming more mature in the app, I've found
components appearing differently than I expected. This wasn't so
obvious first since I was using layout_width/height: fill_parent or
match_parent and wrap_content.  Now when I need to use specific values
in dp or px, I have discovered this:

the mobile device with a 3.5" screen @ 480x800 is using drawable
resources from:
res/drawable-mdpi/

and ignoring
res/drawable-hdpi/

And another strange thing, and must be from the same source of
problem, it is correctly using layout xml files from:
res/layout-normal/

but, from within this layout-normal, it takes a LinearLayout with 90px
(or 90dp, behaves same way for both dp/px) and renders the component
to the real physical screen with a dimension of 135px.  My desired
size is 90 pixels on this dpi, so if I set the
android:layout_height="60px" then it comes out looking great at 90px.
The mdpi -> hdpi conversion is x1.5, and that's the same scale factor
happening here.

I'm totally confused why, and have put time into searching the
documentation.  Haven't found the solution.

Btw, this is an Acer Liquid E phone, with 2.2 on it!

Thanks in advance.

-- 

2. Removing .jar file from project.

At one time I added a .jar file in the lib directory to my project.

Later, I started working without eclipse, just using VIM and adb etc.
I decided that I didn't need anything from the .jar file in question
anymore.  I puffed it, and went on working.

Now I'm using the project from eclipse again.  I can't build because
eclipse can't find the .jar file anymore.  I checked out things like

properties->java build path, and removed the path that had been created
because of the .jar file, and looked around in the tabs and googled for
a while, but I can't seem to make Eclipse let go of this no longer
extant file.

Thanks!

Tobiah

--

3. Android Dashboard - GirdView or LinearLayout

4. How do you add sound to web application?

5. Code coverage report: "no metadata found in any of the data files"

6. Scan for wifi networks when connected to 3G

7. who invoke PhoneApp.