程式碼
pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
pm.reboot(null);
權限
logcat追蹤
錯誤訊息
E/AndroidRuntime(1647): java.lang.NoSuchMethodError: android.os.PowerManager.reboot
說明
Generally that means the class you compiled against and the class you're running against are different versions. The method you are calling was accessible to your compiler but is not available to the JVM at runtime.
能在你的編譯器中編譯,但在裝置上的JVM卻沒有這個me
筆記
reboot method在Standard android platform 2.1-update1不支援。
在Standard andriod platform 2.2才有支援。
沒有留言:
張貼留言