完整的錯誤報告的Android - 擊穿報告的錯誤
java.lang.NoSuchMethodError: android.widget.ImageView.setAlpha
at app1.com.com.DetailActivity.updatePreviousButton(DetailActivity.java:195)
at app1.com.com.DetailActivity.onCreate(DetailActivity.java:115)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
at android.app.ActivityThread.access$2300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
at dalvik.system.NativeStart.main(Native Method)
最近我的應用程序報告下列這是從下面的函數
@SuppressLint("NewApi")
private void updatePreviousButton() {
if (currentPosition == 0) {
prevBtn.setAlpha(0.5f);
prevBtn.setClickable(false);
} else {
prevBtn.setAlpha(1f);
prevBtn.setClickable(true);
}
}
造成錯誤
java.lang.NoSuchMethodError: android.widget.ImageView.setAlpha
其從setAlpha線發生,任何想法如何糾正它。
除去嘗試使用prevBtn.setImageAlpha(INT)。還刪除@SuppressLint(「NewApi」) –
爲什麼人們問問題,並逃跑 –
在這裏即時....只是尋找一些解決方案... – Pooja