1
我的問題是關於這個帖子在Android動態壁紙使用.gif文件
Is it possible to set an animated gif file as live wallpaper in android?
在這篇文章中給出的似乎不工作的方法。當我將我的動畫.gif文件放在/ res/raw文件夾中時,出現錯誤,說明我的文件無法解析或不是字段。有什麼我應該知道的原始文件夾中的資源或有其他一些問題。以下是代碼。
BelleEngine()拋出IOException異常{
InputStream is = getResources().openRawResource(R.raw.ballerina);
if (is != null) {
try {
mBelle = Movie.decodeStream(is);
mBelleDuration = mBelle.duration();
} finally {
is.close();
}
} else {
throw new IOException("Unable to open R.raw.belle");
}
感謝您的幫助提前!