나는 안드로이드 LiveWallpaper catch와 함께 이상한 오류가 발생했습니다. 나는 그것은 2.3ish 주위의 API의 작동이 설정하면 :Strange Catch Try Finally Error
Canvas canvas = null;
//Keep trying till wallpaper is set.
//Error around here..
try
{
canvas = this._surfaceHolder.lockCanvas(null);
synchronized (this._surfaceHolder)
{
this.onDraw(canvas);
}
}
finally
{
if(canvas != null)
{
this._surfaceHolder.unlockCanvasAndPost(canvas);
}
}
을 그리고 이것은 & 벌집이 (실제 장치에서 테스트) ICS에서 작동
Canvas canvas = null;
//Keep trying till wallpaper is set.
//Error around here..
try
{
canvas = this._surfaceHolder.lockCanvas(null);
synchronized (this._surfaceHolder)
{
this.onDraw(canvas);
}
}
finally
{
if(canvas != null)
{
this._surfaceHolder.unlockCanvasAndPost(canvas);
}
}
라이브 배경 화면은 "설정"할 때 오류가 발생합니다 . (서비스는 "예외 잠금 서비스"에 실패합니다.) 하나의 컴파일에서 둘 다 작동하도록하려면 어떻게해야합니까? 두 가지 버전이 필요하지 않습니다.
차이점을 찾을 수 없습니다. – weston
여기에는 실제로 질문이 없습니다. 당신이 가진 오류는 무엇입니까? 그리고 나는 눈이 멀거나 미쳐 가고 있기 때문에 두 코드 조각의 차이점은 무엇입니까? 그들은 저와 동일하게 보입니까? –
@weston이 말한 것, 플러스 - 당신이 시도하고 마침내 사용하는 경우, 당신도 뭔가 잡기 안되니? 던져진 예외를 잡기 때문에 앱이 충돌합니다. – RivieraKid