I have a question about using LayoutInflater.
I have a class which inherits from 'View'.
It calls
LayoutInflater inflater =
(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
if (inflater != null) {
inflater.inflate(R.layout.mycontent, null);
}
inflate returns with no exception.
But then, when I do this:
mRowLayout = (RelativeLayout)findViewById(R.id.row_layout);
I get a null pointer for mRowLayout.
Can you please tell me why? Or how to fix my problem?
<?xml version="1.0" encoding="utf-8"?>
<view class="android.widget.RelativeLayout"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/carousel_film"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<RelativeLayout
android:id="@+id/row_layout"
android:layout_width="fill_parent">
<ImageView
android:id="@+id/left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/left"
/>
</RelativeLayout>
</view>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---