Notepad Sample - adding more columns to listview

by Hein » Wed, 26 Jan 2011 16:24:59 GMT


Sponsored Links
 I've done the notepad tutorial on Google's Android site, but I would
like to know how to add more fields to the list, in columns. At the
moment I can add the columns no problem, but they're not aligned like
you would a normal table on the layout:

john smith
heinrich cilliers
will peck

I would like it aligned as in a html table.

Any pointers?

-- 



Re: Notepad Sample - adding more columns to listview

by Kostya Vasilyev » Wed, 26 Jan 2011 17:06:55 GMT


 Every ListView item layout is separate from those next to it - 
therefore, it positions and sizes its children without any regard for 
other list items.


Two things you can try are:

- Do not try to make a table, and use multi-line layouts instead, the 
screen is typically not wide enough to fit a proper table anyway.


- For a table-like layout, position the views within your item layout so 
that they always have the same size, regardless of the data they 
contain. This can be done by using a LinearLayout, with the children 
having zero layout_width and non-zero layout_weight values.


-- Kostya

26.01.2011 11:24, Hein :
I've done the notepad tutorial on Google's Android site, but I would like to know how to add more fields to the list, in columns. At the moment I can add the columns no problem, but they're not aligned like you would a normal table on the layout: john smith heinrich cilliers will peck I would like it aligned as in a html table. Any pointers?
-- Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com --


Sponsored Links


Re: Notepad Sample - adding more columns to listview

by Hein » Wed, 26 Jan 2011 19:43:02 GMT


 Thank you so much.

I am considering breaking the table up into multiple views as one see
in some other apps.

It just seems strange that there is no way to do this in android,
however I've seen it in other apps, "Iriduim Flares" for example,
which shows many numerals in columns and it's easy to read accross,
perfect for what I needed.

Thanks again for responding.




-- 



Re: Re: Notepad Sample - adding more columns to listview

by Kostya Vasilyev » Wed, 26 Jan 2011 19:51:20 GMT


 The popup in Iridium Flares looks like a TableLayout:

 http://developer.android.com/reference/android/widget/TableLayout.html 

TableLayout doesn't recycle views like ListView, and so isn't really 
suited for long scrollable lists, but it's just fine for presenting 
compact data (also useful for lining up controls within a layout).


-- Kostya

26.01.2011 14:42, Hein :
Thank you so much. I am considering breaking the table up into multiple views as one see in some other apps. It just seems strange that there is no way to do this in android, however I've seen it in other apps, "Iriduim Flares" for example, which shows many numerals in columns and it's easy to read accross, perfect for what I needed. Thanks again for responding.
Every ListView item layout is separate from those next to it - therefore, it positions and sizes its children without any regard for other list items. Two things you can try are: - Do not try to make a table, and use multi-line layouts instead, the screen is typically not wide enough to fit a proper table anyway. - For a table-like layout, position the views within your item layout so that they always have the same size, regardless of the data they contain. This can be done by using a LinearLayout, with the children having zero layout_width and non-zero layout_weight values. -- Kostya 26.01.2011 11:24, Hein :
I've done the notepad tutorial on Google's Android site, but I would like to know how to add more fields to the list, in columns. At the moment I can add the columns no problem, but they're not aligned like you would a normal table on the layout: john smith heinrich cilliers will peck I would like it aligned as in a html table. Any pointers?
-- Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com
-- Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com --



Re: Re: Notepad Sample - adding more columns to listview

by fatima mansuri » Thu, 27 Jan 2011 12:30:55 GMT


 please don't send message me

-- 



Re: Notepad Sample - adding more columns to listview

by Hein » Thu, 27 Jan 2011 14:48:11 GMT


 I thought one could not do a row click on a table, so I assumed
otherwise. Pity. Thanks again.




-- 



Other Threads

1. Device Interface to Android Phone

I'd like to develop a device that interfaces to a G1 or other upcoming
Android phone. The phone would be docked to this device in order to
provide some external functionality. The G1 has the following
interface - HTC ExtUSB(11-pin mini-USB 2.0 and audio jack in one) -
but I'm not sure if this is feasible to use. I haven't seen an
optional API that addresses the interface over a USB connection.

If the only way "standard" way to talk between a peripheral device and
an Android phone is Bluetooth, will the Bluetooth API be available
sometime soon? This setup would use Bluetooth to send/receive data and
the USB connection purely for power.


--~--~---------~--~----~------------~-------~--~----~

2. How to get an interface on a service without destroying the service at unbind

My service works exactly the way i want as long as i use start and
stop
and communicate using intents.

However my activity needs to change the state of my service as well as
retrieving
state information.

So i thought it would be nice to broadcast some kind of state_changed
event from
my service and use a binder interface to pull information from the
service or change
the services state based on user input.

This works fine too.
The only problem is that my service gets killed when i unbind it just
as the documentation says.

Is there any way to keep the service alive but still get an interface
to control it directly.
My activity offers the user a way to stop the service and the service
kills itself anyway
after it's work is done but i don't want the service to stop every
time the activity is destroyed.

Thanks in advance
Michael

--~--~---------~--~----~------------~-------~--~----~

3. unzip

4. help about SMS BroadcastReceiver conflict with GPS LOCATION_SERVICE

5. execute unix command from an android app

6. Pick multiple contacts from the contacts application

7. SAXParser fails on some RSS feeds