Meryl Silverburgh wrote:
> 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);

Or, you can get your activity by calling getContext() in your View and
casting it to an Activity. Then, call getLayoutInflater() on the
Activity. Either way works.

>               if (inflater != null) {
>                       inflater.inflate(R.layout.mycontent, null);
>               }

inflate() returns a View, the result of the inflation.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 2.0 Available!

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