Mark,

Thanks for the reply but No Dice....

When I change the $ to a . I get a ClassNotFoundException.

As far as . being the separator, I am aware of that but the Dev Guide was
very clear about using the $:

Taken directly from
http://developer.android.com/guide/topics/ui/custom-components.html:

<view
  class="com.android.notepad.NoteEditor$MyEditText"

  id="@+id/note"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:background="@android:drawable/empty"
  android:padding="10dip"

  android:scrollbars="vertical"
  android:fadingEdge="vertical" />

The custom component is created as a generic view in the XML, and the class
is specified using the full package. Note also that the inner class we
defined is referenced using the NoteEditor$MyEditText notation which is a
standard way to refer to inner classes in the Java programming language.


Thanks,
Justin

----------------------------------------------------------------------
There are only 10 types of people in the world...
Those who know binary and those who don't.
----------------------------------------------------------------------


On Sat, Sep 19, 2009 at 2:50 AM, Mark Murphy <[email protected]>wrote:

>
> MagouyaWare wrote:
> > I am not able to successfully reference an internal subclass of a view
> > in my xml layout file.
> >
> > I followed the example in the Dev Guide and the NotePad example in API
> > Demos and it is not working.  I'm sure it has got to be something
> > simple that I have overlooked or missed.
> >
> > Here is what I have:
> >
> > A package named com.magouyaware.appswipe, a class called
> > ActivityListView that inherits from Activity, and a  nested inner
> > class named RunningTaskGallery that inherits from Gallery.
> >
> > According to the Dev Guide, I would reference it in the layout file as
> > follows:
> > <view class="com.magouyaware.appswipe.ActivityListView
> > $RunningTaskGallery" />
> >
> > However, this results in: java.lang.NoSuchMethodException:
> > RunningTaskGallery(Context,AttributeSet).  I double-checked just to
> > make sure, but this constructor does indeed exist.
> >
> > Any ideas?
>
> Try replacing your $ with a . and see if that works. $ notation is used
> in things like stack traces, but in Java code, the dot is the separator
> (think LinearLayout.LayoutParams and Settings.Secure).
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://twitter.com/commonsguy
>
> _Android Programming Tutorials_ Version 1.0 Available!
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to