Q:

Error with setAlpha

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)

A:

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

