final Method method = this.getClass().getMethod("publicMethod", View.class);
throws a MethodNotFoundException only on Android 2.3 devices (higher Android versions return the method). This is what Android uses to handle xml onClicks, which means all of them are crashing in my app on 2.3 devices. However,
final Method method = this.getClass().getDeclaredMethod("publicMethod", View.class);
Successfully returns the method.
Here is the method (which is in the same class as the above calls):
public void sort(final View v){
//Stuff
}
Aucun commentaire:
Enregistrer un commentaire