Thank you for your answer,

I call setOnClickListener() in the Activity while I create the list of
views. Then i give this list to the adapter. The Adapter::getView()
method just returns the view _list.get(position). See below for code
sample.

But I would like to say that the onclick behavior is very very strange
on that list (although everything works with Android 2.1). The last
item reacts correctly, but the previous ones seem to stack the call
and execute the whole stack as a batch when any action finally
succeeds.

In the Activity:

_listView = new ListView(this);
[ ... ]
PeriodListAdapter adapter = new PeriodListAdapter();

OnClickListener openMenu = new OnClickListener() {
        @Override
        public void onClick(View v) {
                PeriodActivity.this.openContextMenu(v);
        }
};

PeriodDescription therapyP = new PeriodDescription(this);
therapyP.setPeriod(p);
therapyP.setOnClickMenu(openMenu);
adapter.addPeriodDescription(therapyP);

[ ... ]

_listView.setAdapter(adapter);


Thanks for your interest

Thibaut, a poor disappointed developer...




On 7 oct, 11:46, Daniel Drozdzewski <[email protected]>
wrote:
> On Thu, Oct 7, 2010 at 9:15 AM, Thibaut <[email protected]> wrote:
> > The second trouble is resolved thanks to another message in this
> > google group 
> > (http://groups.google.com/group/android-developers/browse_thread/threa...
> > ). Nested scrollviews don't work anymore.
>
> > Does anyone have an idea why several click attempts are necessary to
> > open the context menu by clicking on an ImageView (located inside a
> > ListView)?
>
> Thibaud,
>
> Where in your code do you call setOnClickListener() ? Please remember
> that ListView recycles the views behind each list item.
> Quick peek at your Adapter.getView() method would help here.
>
> Daniel
>
>
>
> > On 6 oct, 20:30, Thibaut <[email protected]> wrote:
> >> Hello,
>
> >> I have some strange UI troubles with Android 2.2.
>
> >> First, I set an OnClickListener on an ImageView that should open the
> >> context menu. Nothing happens on the first click attempts, but the
> >> next ones trigger several context menu openings (the menu opens itself
> >> when a menu item is selected) ...
>
> >> Second, if the screen is landscape-oriented, a HorizontalScrollViewer
> >> doesn't scroll as expected. It breaks its self movements, giving the
> >> feeling to scroll step by step. Its behavior is normal when the screen
> >> is portrait-oriented.
>
> >> And everything is normal with Android 2.1.
>
> >> Thanks
>
> >> Thibaut

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to