0

hi guys i need your help because of this error:

here is the logcat:

07-30 16:12:33.823: E/AndroidRuntime(21283): java.lang.NoSuchMethodError: android.widget.LinearLayout.setAlpha
07-30 16:12:33.823: E/AndroidRuntime(21283):    at it.bisemanuDEV.piano.livello1$1.onClick(livello1.java:393)
07-30 16:12:33.823: E/AndroidRuntime(21283):    at android.view.View.performClick(View.java:2408)
07-30 16:12:33.823: E/AndroidRuntime(21283):    at android.view.View$PerformClick.run(View.java:8819)
07-30 16:12:33.823: E/AndroidRuntime(21283):    at android.os.Handler.handleCallback(Handler.java:603)
07-30 16:12:33.823: E/AndroidRuntime(21283):    at android.os.Handler.dispatchMessage(Handler.java:92)
07-30 16:12:33.823: E/AndroidRuntime(21283):    at android.os.Looper.loop(Looper.java:123)
07-30 16:12:33.823: E/AndroidRuntime(21283):    at android.app.ActivityThread.main(ActivityThread.java:4627)
07-30 16:12:33.823: E/AndroidRuntime(21283):    at java.lang.reflect.Method.invokeNative(Native Method)
07-30 16:12:33.823: E/AndroidRuntime(21283):    at java.lang.reflect.Method.invoke(Method.java:521)
07-30 16:12:33.823: E/AndroidRuntime(21283):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
07-30 16:12:33.823: E/AndroidRuntime(21283):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
07-30 16:12:33.823: E/AndroidRuntime(21283):    at dalvik.system.NativeStart.main(Native Method)
whiteTIGER
  • 391
  • 1
  • 6
  • 19
  • I think this could help you :) (java.lang.NoSuchMethodError: android.widget.LinearLayout.setAlpha.. aka in the linear layout element you cannot use setAlpha) http://stackoverflow.com/questions/4813995/set-alpha-opacity-of-layout – sataniccrow Jul 30 '12 at 14:19
  • I refer you http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/NoSuchMethodError.html. Which gives you some information about why this error occurs. – Vinay Jul 30 '12 at 14:21
  • setAlpha method is only available since API number 11. Get the latest ADT and run the lint tool. It has many rules to detect this kind of error. – Prakash Nadar Jul 30 '12 at 14:25

1 Answers1

5

setAlpha() was introduced in API11. You could be getting this error because you are supporting too low of an API for this method. Since it doesn't exist at an API < 11 the compiler will throw a NoSuchMethodError exception. You could also accidentally be overloading the method by not passing through a float. If the API level is the problem, you might want to try the link that sataniccrow provided: Set Alpha/Opacity of Layout

Community
  • 1
  • 1
telkins
  • 10,440
  • 8
  • 52
  • 79