我想在我的布局中加载动画gif并使用此代码
public class Main extends Activity {
ImageView iv;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
iv = (ImageView) findViewById(R.id.imageView1);
Glide.with(Main.this)
.load(R.drawable.gif)
.asGif()
.fitCenter()
.into(iv);
}
但布局没有任何反应! log cat:
12-19 05:50:30.834: E/PriorityExecutor(1517): Request threw uncaught throwable
12-19 05:50:30.834: E/PriorityExecutor(1517): java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/bumptech/glide/disklrucache/DiskLruCache;
12-19 05:50:30.834: E/PriorityExecutor(1517): at java.util.concurrent.FutureTask.report(FutureTask.java:93)
12-19 05:50:30.834: E/PriorityExecutor(1517): at java.util.concurrent.FutureTask.get(FutureTask.java:163)
12-19 05:50:30.834: E/PriorityExecutor(1517): at com.bumptech.glide.load.engine.executor.FifoPriorityThreadPoolExecutor.afterExecute(FifoPriorityThreadPoolExecutor.java:96)
12-19 05:50:30.834: E/PriorityExecutor(1517): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1120)
12-19 05:50:30.834: E/PriorityExecutor(1517): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
12-19 05:50:30.834: E/PriorityExecutor(1517): at java.lang.Thread.run(Thread.java:818)
12-19 05:50:30.834: E/PriorityExecutor(1517): at com.bumptech.glide.load.engine.executor.FifoPriorityThreadPoolExecutor$DefaultThreadFactory$1.run(FifoPriorityThreadPoolExecutor.java:118)
12-19 05:50:30.834: E/PriorityExecutor(1517): Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/bumptech/glide/disklrucache/DiskLruCache;
12-19 05:50:30.834: E/PriorityExecutor(1517): at com.bumptech.glide.load.engine.cache.DiskLruCacheWrapper.getDiskCache(DiskLruCacheWrapper.java:59)
12-19 05:50:30.834: E/PriorityExecutor(1517): at com.bumptech.glide.load.engine.cache.DiskLruCacheWrapper.get(DiskLruCacheWrapper.java:76)
12-19 05:50:30.834: E/PriorityExecutor(1517): at com.bumptech.glide.load.engine.DecodeJob.loadFromCache(DecodeJob.java:215)
12-19 05:50:30.834: E/PriorityExecutor(1517): at com.bumptech.glide.load.engine.DecodeJob.decodeResultFromCache(DecodeJob.java:85)
12-19 05:50:30.834: E/PriorityExecutor(1517): at com.bumptech.glide.load.engine.EngineRunnable.decodeFromCache(EngineRunnable.java:108)
12-19 05:50:30.834: E/PriorityExecutor(1517): at com.bumptech.glide.load.engine.EngineRunnable.decode(EngineRunnable.java:99)
12-19 05:50:30.834: E/PriorityExecutor(1517): at com.bumptech.glide.load.engine.EngineRunnable.run(EngineRunnable.java:58)
12-19 05:50:30.834: E/PriorityExecutor(1517): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
12-19 05:50:30.834: E/PriorityExecutor(1517): at java.util.concurrent.FutureTask.run(FutureTask.java:237)
12-19 05:50:30.834: E/PriorityExecutor(1517): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
12-19 05:50:30.834: E/PriorityExecutor(1517): ... 3 more
我认为一类滑行没有加载!