Methods referred by the XML onClick attributes are invoked by reflection,
which is why Proguard believes they should be removed. You should file a
feature request (enhancement) at b.android.com if you'd like the tools to
keep these methods.

On Sun, May 1, 2011 at 6:55 PM, Ted Hopp <ted.h...@gmail.com> wrote:

> Apparently proguard decides that it's an unused method because nothing
> in my code references it, and optimizes it away.
>
>
> On May 1, 9:10 pm, a a <harvey.a...@gmail.com> wrote:
> > 2011/5/2 Ted Hopp <ted.h...@gmail.com>:
> >
> > > For every new project, I always have to add the following lines to
> > > proguard.cfg:
> >
> > >    -keepclassmembers class * extends android.app.Activity {
> > >       public void *(android.view.View);
> > >    }
> >
> > > Otherwise the onClick methods disappear when I publish the app. Is
> >
> > why?
> >
> >
> >
> > > there a way for us to change the default proguard.cfg file that's
> > > created with a new project?
> >
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "Android Developers" group.
> > > To post to this group, send email to
> android-developers@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > android-developers+unsubscr...@googlegroups.com
> > > For more options, visit this group at
> > >http://groups.google.com/group/android-developers?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to