Stacking a ListView with other widgets below?

by Romain Guy » Sat, 14 Nov 2009 07:13:49 GMT


Sponsored Links
 Don't use a ScrollView, it won't work. Add footers to your ListView.



>



Stacking a ListView with other widgets below?

by Mark Wyszomierski » Sat, 14 Nov 2009 07:27:35 GMT


 Hi Romain,

If I use a footer view, it can get focus, but its internal controls
cannot be focused using the scroll ball? For example, this is a simple
footer view:

  LinearLayout llFooter = new LinearLayout(this);
  llFooter.setLayoutParams(new AbsListView.LayoutParams
(AbsListView.LayoutParams.FILL_PARENT,
AbsListView.LayoutParams.WRAP_CONTENT));

   Button btn1 = new Button(this);
   btn1.setText("Btn1");
   llFooter.addView(btn1);

When I use the scroll ball the navigate to the footer, the entire
background gets highlighted, and I cannot access the button on the
layout. Is there some way of doing that for a better user experience,
or do users just have to touch with their finger?

Thanks





> >


Sponsored Links


Stacking a ListView with other widgets below?

by Romain Guy » Sat, 14 Nov 2009 07:40:46 GMT


 When you add the footer to the listview you need to indicate it can
receive focus: 
 http://d.android.com/reference/android/widget/ListView.html #setItemsCanFocus(boolean)





>> >



Stacking a ListView with other widgets below?

by Mark Wyszomierski » Sat, 14 Nov 2009 07:53:01 GMT


 Romain, thanks, that saved me.






> >> >



Stacking a ListView with other widgets below?

by Mark Wyszomierski » Sun, 15 Nov 2009 02:08:26 GMT


 ne more question on this - it seems like if we use a header or footer
view - then our activity can not add any other views? Example:

<LinearLayout>
<ListView> // with header and footer views.
</LinearLayout>

the above works perfectly with focus getting routed correctly etc. The
focus acts strangely in this case though:

<LinearLayout>
<LinearLayout>
<Button>
</LinearLayout>
<ListView>
</LinearLayout>

if the list view has focusable items - then the focus jumps back up to
the top LinearLayout-button after hitting down key again. This is kind
of strange, should this be happening? To explain further:

<LinearLayout>
<LinearLayout>
<Button>
</LinearLayout>
<ListView>
// listview is composed of:
TextView
TextView
Button
TextView
</ListView>
</LinearLayout>

so focus is fine up until it hits the row with the Button. The button
gets highlighted (since itemsCanFocus=true), but then hitting the down
arrow key again jumps focus up to the top linear layout button,
instead of continuing focus to the next row of the ListView. Normally
I could just use a header view instead, but is there an undocumented
rule in which we cannot add other views to our layout if using a
ListView with setItemsCanFocus=true?

Thanks

On Nov 13, 6:52pm, Mark Wyszomierski <mar...@gmail.com> wrote:
> > >> >



Stacking a ListView with other widgets below?

by Mark Wyszomierski » Sun, 15 Nov 2009 04:03:04 GMT


 his is problem is probably related to this ListView bug:
http://code.google.com/p/android/issues/detail?id=4255#c2

On Nov 14, 1:07pm, Mark Wyszomierski <mar...@gmail.com> wrote:
> > > >> >



Other Threads

1. Accessing Objects created in Service from Activity

Hi All,

We are developing an Android Product, where we have Queues which are
created by Services and accessed by Activities. In general, I know
that objects (irrespective of where they are created ) in Android will
live in the same JVM and are accessing by any other object on the same
JVM.

The idea in our product is that the Service is always running and
listening for certain phone events and pushing these in the queue for
processing. The UI (Activity if its running) will show the status of
the Queue and it currently accesses the queue directly.

Now the questions which I have are following
1. Is it a good idea to access objects created by Service directly
from Activity?
    OR
    Should I always access these from AIDL Interface?

2. Say my Service starts a thread to consume the queue which we have,
Should this thread be daemon thread? I dont want this thread to last
more than life cycle of the Service.

3. What is the best way to keep a Service running forever (this is the
nature of the app)?


Cheers,
Rohit

-- 

2. Android Library Update

Every time I launch Eclipse there is an "Android Library Update"
message in the status bar and it rebuilds all my apps.  I this
supposed to happen?  It takes a long time.

-- 

3. Do the latest SDK&ADT not support Cupcake(1.5)?

4. .rodata section

5. 45rb test, browser android vs iPhone

6. tethering eth0 interface

7. Android Kernel Build Errors- Yaffs2 Errors