Er...  if you have an ArrayList that you are putting one item in, why not
just have a pointer?  Much less overhead.

Also you can assign your own id and still use findViewById().

And keep in mind that AbsoluteLayout is being deprecated in Cupcake, and we
strongly discourage its use since it is very likely you won't be dealing
with the screen being resized.  Generally the best solution would be to just
implement your own layout manager that does your desired layout, as needed,
and can also keep track of interesting views it has in it.

On Sat, Apr 18, 2009 at 4:22 PM, DeRon Brown <dmbrown2...@gmail.com> wrote:

> I'm not using XML, so that won't work for me, I don't think. However, I
> found another solution. I'm just going to use a button ArrayList (of size
> 1). Each time I'll check to see if the ArrayList's size is greater than
> zero, if it is, I remove the button in the list from the view.
>
>
> On Sat, Apr 18, 2009 at 7:15 PM, Marco Nelissen <marc...@android.com>wrote:
>
>> View.findViewById() ?
>>
>>
>>
>> On Sat, Apr 18, 2009 at 2:52 PM, xspotlivin <dmbrown2...@gmail.com>wrote:
>>
>>>
>>> Is there a way to check if a view contains another certain view? I
>>> have an AbsoluteLayout view that I add multiple views to (buttons). I
>>> have a certain button, let's call it reportButton, and I want to check
>>> to see if its already within my AbsoluteLayout view. Is there like an
>>> AbsoluteLayout.contains(reportButton) method or something of the kind?
>>>
>>> This is what I want to do. "myLayout" is the absolutelayout and
>>> "reportAll" is the button.
>>>
>>>    class reportAllButtonThread implements Runnable {
>>>        //@Override
>>>        public void run() {
>>>                while(true) {
>>>                        if (myLayout.contains(reportAll)) {
>>>                                //Do something
>>>                        }
>>>                }
>>>        }
>>>    }
>>>
>>> Suggestions?
>>>
>>> Thanks.
>>>
>>>
>>
>>
>>
>
> >
>


-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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

Reply via email to