Hi,

   Your suggestion doesn't work.I have an event.xml defined as:

<merge xmlns:android="http://schemas.android.com/apk/res/android";>

<RelativeLayout
android:id="@+id/relativeLayoutevent"
android:layout_width="wrap_content"
android:layout_height ="wrap_content"
android:background="@drawable/lock"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true">

<Button
android:id="@+id/buttonevent"
android:background="@drawable/redalarm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

</RelativeLayout>

</merge>

and a framelyout deifned as :

framelayout1 = new FrameLayout(this);
                FrameLayout.LayoutParams r1 = new
FrameLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT);
        framelayout1.setBackgroundColor(Color.BLACK);
                framelayout1.setLayoutParams(r1);

and when I use:

RelativeLayout relativelayoutevent = (RelativeLayout)
getLayoutInflater().inflate(R.layout.event, null);
        FrameLayout.LayoutParams tempparams= new
FrameLayout.LayoutParams
(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT,Gravity.BOTTOM|
Gravity.LEFT);
        relativelayoutevent.setLayoutParams(tempparams);
        framelayout1.addView(relativelayoutevent);

the application crashes. Is there anything differently that needs to
be done?

Thank you,
B.Arunkumar

On Dec 2, 11:00 am, TreKing <[email protected]> wrote:
> On Thu, Dec 1, 2011 at 11:48 PM, B.Arunkumar
> <[email protected]>wrote:
>
> >  I have a layout defined programmatically in activity class. How do
> > I include the layout header (defined as xml) in the layout defined
> > programmatically (not as xml) in the activity class.
>
> http://developer.android.com/reference/android/view/LayoutInflater.html
>
> -------------------------------------------------------------------------------------------------
> TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
> transit tracking app for Android-powered devices

-- 
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