在你的清单中添加这个:
<application android:name=".App"
然后创建应用程序上下文类:
public class App extends Application { @Override public void onCreate() { super.onCreate(); ViewTarget.setTagId(R.id.glide_tag); } }
添加以下内容作为内容src/main/values/ids.xml
:
<resources> <item type="id" name="glide_tag" /> </resources>
(或者只需将上面添加<item ... />
到任何resources
xml中values
)