Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5929459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:25:27+00:00 2026-05-22T14:25:27+00:00

I am using the android:onClick atribute in some of my .xml layout files for

  • 0

I am using the android:onClick atribute in some of my .xml layout files for my android application, but ProGuard is removing these methods from my code when it runs because nothing in my code is ever calling them.

Rather then specifying each function individually, I would like to name them something like listener_functionName, and use wildcards, like -keep listener_* (I know this is incorrect, but hopefully it illustrates my goal).

If this is possible that would be great, but if not I still need to know how to specify these functions in the proguard.cfg file. Any help is appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T14:25:27+00:00Added an answer on May 22, 2026 at 2:25 pm

    According to proguard documentation:

    Fields and methods may also be
    specified using regular expressions.
    Names can contain the following
    wildcards: ? matches any single
    character in a method name.
    * matches any part of a method name.

    so, you will be find specifying

    -keep class com.example.MyClass {
      public void listener_*(android.view.View);
    }
    

    in your proguard flags.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some problem with eclipse android. I have some java files, but if
This is a Java syntax question, but just for some background. Using android, I
When using Proguard with Android, methods that are only invoked via reflection (e.g., callbacks
Using Android opengl I need to move an object from point A to point
I am using Android SDK 1.6 and developing some simple apps. It seems everytime
I am using android java to create an application that uses the accelerometer, i
I am having trouble with developing my Android application, I am currently using Eclipse
I'm using an Android PopupWindow in an application so I want to be sure
I am using a translate animation: <?xml version=1.0 encoding=utf-8?> <set xmlns:android=http://schemas.android.com/apk/res/android> <translate android:fromXDelta=-75%p android:toXDelta=0%p
I am using android-facebook-sdk and i am trying to request profile information. But i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.