2011-05-23 12 views
0

長い話ですが、ShutdownThreadディレクトリを呼び出して電話を再開しようとしていますそれは私にこのエラーを与えるとして、それはなど、私のコンテキストを好きではない、いくつかの理由が...任意の助けいただければ幸いです....

.NativeStart.main(Native Method) 
    [exec] 05-23 16:32:36.354 5573 5573 W System.err: Caused by: android.view 
.WindowManager$BadTokenException: Unable to add window [email protected] 
5985ae0 -- permission denied for this window type 
    [exec] 05-23 16:32:36.362 5573 5573 W System.err:  at android.view. 


/** 
* Request a clean shutdown, waiting for subsystems to clean up their 
* state etc. Must be called from a Looper thread in which its UI 
* is shown. 
* 
* @param context Context used to display the shutdown progress dialog. 
* @param reason code to pass to the kernel (e.g. "recovery"), or null. 
* @param confirm true if user confirmation is needed before shutting down. 
*/ 
public static void reboot(final Context context, String reason, boolean confirm) { 
    mReboot = true; 
    mRebootReason = reason; 
    shutdown(context, confirm); 
} 
+0

あなたはこの答えが正しいと判明した場合は、チェックマークを入れてそれを受け入れます。それ以外の場合は問題を説明してください。別の解決策があれば、投稿してください。 – Mathew

答えて

0

あなたreboot()コンテキストパラメータのgetParent()を与えて試してみて、参照を呼び出している間。

0

AndroidManifestに以下の許可を追加してください。あなたがそれを持っていない場合。

android.permission.SYSTEM_ALERT_WINDOW

関連する問題