내가있는 내가 다음 코드를 사용하여 GIF 이미지를 사용하고, 안드로이드 응용 프로그램을 개발하고표면보기에서 Gif 이미지를 사용 하시겠습니까?
private static byte[] streamToBytes(InputStream is) {
ByteArrayOutputStream os = new ByteArrayOutputStream(1024);
byte[] buffer = new byte[1024];
int len;
try {
while ((len = is.read(buffer)) >= 0) {
os.write(buffer, 0, len);
}
} catch (java.io.IOException e) {
}
return os.toByteArray();
}
// 클래스
is = this.context.getResources().openRawResource(R.drawable.fondo_juego_nexus);
if (DECODE_STREAM) {
System.out.println("in if DECODE_STREAM");
mMovie = Movie.decodeStream(is);
}
else {
byte[] array = streamToBytes(is);
System.out.println("in else DECODE_STREAM");
mMovie = Movie.decodeByteArray(array, 0, array.length);
}
// In On Draw
long now = android.os.SystemClock.uptimeMillis();
if (mMovieStart == 0) { // first time
mMovieStart = now;
}
if (mMovie != null) {
System.out.println("in if (mMovie != null) " + mMovie.duration());
int dur = mMovie.duration();
if (dur == 0)
{
dur = 1000;
System.out.println("in if movie if");
}
System.out.println("duration is "+ dur);
int relTime = (int)((now - mMovieStart) % dur);
mMovie.setTime(relTime);
System.out.println("in if displaying syd");
mMovie.draw(canvas,120,100);
}
과 같은 활동에서 ontouch 내가 출구로 생성자에서 내가 위의 방법으로 활동을 종료하고, 이전 작업을 다시 가서 활동 어에 다시 올
else if(_y<=60 && _x<=60)
{
sp.play(mySound1, volume, volume, 0, 0, 1);
sp.release();
playr.stop();
tme.cancel();
act.finish();
}
니어 나는 장치 은하계 S2, 2.3.3에 나타나지 않지만 2.2의 동일한 크기의 에뮬레이터에서 GIF 이미지를 사용하고있다.
이 접근법에 어떤 문제가 있거나 어떤 방식으로 표시 할 수 있습니까? GIF 이미지는
나는 내 문제에 대한 해결책을 가지고이 오류