Hey Brian,

I've run into a similar issue with mContext. I'm currently looking
into the solution of bringing in the LinearLayout, ViewGroup and View
classes mentioned but your solution seems easier. Could you elaborate
on what it is you did with the line of code mentioned in your post?
How it fit into your clone of NumberPicker.java?

Many Thanks,
Kai

On Dec 18 2009, 7:38 pm, Brian Conrad <[email protected]> wrote:
> Thanks.  This worked for my own use:
>
> LayoutInflater.from(context).inflate(R.layout.number_picker, this, true);
>
> And now it works.
>
> clark wrote:
> > If you follow the inheritance back from NumberPicker.java, which
> > extends LinearLayout, which extends ViewGroup, which extends View, you
> > will find mContext defined.  Gotta follow the paper trail a bit. :)
>
> > -L!TH-
>
> > On Dec 18, 3:41 pm, Brian Conrad <[email protected]> wrote:
>
> >> This mContext is not declared nor initialized in the NumberPicker.java
> >> source.  Is it a global and if so how would you initialize when using
> >> this code on your own?  If you use the context that is passed it won't
> >> work.  I must be missing something here.
>
> >> mInflater = (LayoutInflater)
> >> mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
>
> >> - Brian
>
> >> Hong wrote:
>
> >>> Sorry search: NumberPicker.java ;)
>
> >>> On Thu, Dec 17, 2009 at 8:47 PM, Hong <[email protected]> wrote:
>
> >>>> Search "NumberPicker" in Google, the first link:
>
> >>>>http://www.netmite.com/android/mydroid/cupcake/frameworks/base/core/j...
>
> >>> --
>
> >>> You received this message because you are subscribed to the Google Groups 
> >>> "Android Discuss" 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 
> >>> athttp://groups.google.com/group/android-discuss?hl=en.-Hide quoted text -
>
> >> - Show quoted text -
>
> > --
>
> > You received this message because you are subscribed to the Google Groups 
> > "Android Discuss" 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 
> > athttp://groups.google.com/group/android-discuss?hl=en.
-- 
You received this message because you are subscribed to the Google Groups 
"Android Discuss" 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-discuss?hl=en.


Reply via email to