Swapping in and out ViewGroups (Layout) within a container ViewGroup.

by steele johnson » Sat, 31 Jan 2009 06:09:04 GMT


Sponsored Links
 Thanks for the help. I'll check out ViewFlipper.





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



Swapping in and out ViewGroups (Layout) within a container ViewGroup.

by steele johnson » Sat, 31 Jan 2009 06:39:27 GMT


 Hello,
ViewFlipper doesn't help either because I still need to add the layout
dynamically. The problem really comes down to this:

mInnerLayout = (LinearLayout) layout.inflate(
                                        R.layout.multiple_select, 
mContainerLayout);

How can I add mInnerLayout to mContainerLayout after it has been
removed?





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


Sponsored Links


Swapping in and out ViewGroups (Layout) within a container ViewGroup.

by steele johnson » Sat, 31 Jan 2009 06:51:28 GMT


 Ok, I figured it out.

When you use LayoutInflater.inflate(id, root), the return value will
be the inflated xml root if you _didn't_ provide the root, or it will
be the root if you did. To remedy the problem I was having, I simple
passed null for the root and then called mContainerLayout.addView
(mInnerLayout) and it worked. What was happen is that it was returning
the root and I thought it was the inner layout. ;)





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



Other Threads

1. Problem finding a contact when ID is known

I am having a problem viewing a contact in my app when I know the ID
(because we just queried and stored it).

I see some comments that a "LOOKUP_URI" is required but I don't know
how to use it and no matter what, I get "The contact does not exist"
even though I know with 100% certainty that it does.

Can someone explain based on the following code snippet:

String name = ContactNameList.get(position);
String strID = ContactIDList.get(position);
Uri contactUri = ContactsContract.Contacts.getLookupUri(Long.parseLong
(strID), "name='"+name + "'");
Intent intent = new Intent(Intent.ACTION_VIEW,contactUri);
                                startActivity(intent);

I am finding that ID = 676 for example and that is getting parsed
correctly and also that name='Joe Smith' does not throw an error but
my activity does not open the contact - I only get the message "The
contact does not exist" in a toast.

Please help!  Thanks very much!

-- 

2. How can Camera API support two camera device?

I think you want:
http://bit.ly/9LfmQ0

The framework supplies two values,  VideoSource.CAMERA and
VideoSource.DEFAULT. If you're developing this device, I think you
should take CAMERA to mean "default camera", probably with a way for
the user to select which is the default. Other values (i.e. integers
greater than 1) would specify a specific camera.

If someone else developed it -- you'll have to ask them what they did,
or try using 2, etc. for the VideoSource and see what happens.




-- 

3. How can I signal an AppWidgetProvider from a service running in another process

4. showing XML data in TAB in ANDROID

5. Problem sending a file via Bluetooth

6. size limit of shared preferences

7. How to format the second partition on an SD Card using terminal emulator?