2013-03-02 2 views
0

나는 다음과 같은 코드를 가지고 :창 관리자 removeView는 "하드웨어 가속을 ..."던져 예외

protected View progressView; 
protected LayoutParams progressParams; 

class Task extends AsyncTask<String, Void, Result> { 
    String timeleft; 
    String error; 

    @Override 
    protected Result doInBackground(String... s) {   
     // ... 
    } 

    @Override 
    public void onPreExecute() { 
     getWindowManager().addView(progressView, progressParams); 
    } 

    @Override 
    protected void onPostExecute(Result result) {   
     getWindowManager().removeView(progressView); // throws exception 
     // ... 
    } 
} 

내가 (안 에뮬레이터에서) 내 전화를받을 수 있나요이 오류. 아마도 내가 물건을 많이 사용할 수 있고 "가장자리에 살고"있는 tyween에서 HTC HD2 안드로이드 ROM을 사용하기 때문에.

03-02 22:53:08.303: E/test(5573): Exception: Hardware acceleration can only be used with a single UI thread. 
03-02 22:53:08.303: E/test(5573): Original thread: Thread[main,5,main] 
03-02 22:53:08.303: E/test(5573): Current thread: Thread[background thread,5,main] 

어떻게이 오류를 해결할 수 있습니까?

+0

doInBackground에서 수동으로 onPostExecute를 호출 할 수 있습니까? – Leonidos

+0

그렇지 않습니다. 확실히 정규 AsyncTask 사용법 ... –

답변

1

이 문제는 manifest의 application 태그에 android : hardwareAccelerated = "false"를 넣으면 피할 수 있습니다. 그러나 그것은 물론 문제를 해결하지 못합니다.

0

UI 스레드에보기를 추가하십시오.

관련 문제