moiraine wrote:
> Hrm, I'm really tired right now so might be missing something stupid,
> but right now the code i have is:
> 
> 
>               final ViewFlipper flipper = null;
> 
>               final Button Button04 = (Button) findViewById(R.id.Button04);
> 
>               final LinearLayout llayout = new 
> LinearLayout(R.layout.business);

???

> 
>               Button04.setOnClickListener(new View.OnClickListener(){
>                       public void onClick(View v) {
>                               flipper.showContextMenuForChild(llayout);

???

> 
>                       }
>               });
> 
> which... well, doesn't work - it doesn't like the "new
> LinearLayout(R.layout.business);" part, saying "business" has to be an
> int.  business refers to business.xml.  I'm not sure how to do this
> and have tried to find examples for showContextMenuForChild, but can't
> find any applicable to my use.

1. You do not inflate layouts from XML via constructors. You inflate
layouts from XML using LayoutInflater.

2. Generally, you do not inflate layouts from XML for use with
ViewFlipper. Rather, you combine those other layouts into your main one,
as children of <ViewFlipper>. If you physically want them as separate
XML files, use the <include> element to combine them at compile time.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

_The Busy Coder's Guide to *Advanced* Android Development_
Version 1.5 Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to