我正在使用actionbar sherlock和UriImageViewHelper库将图像设置为主页图标。
这是我的代码
ImageView view = (ImageView) getWindow().getDecorView().findViewById(android.R.id.home);//(ImageView) findViewById(android.R.id.home);
UrlImageViewHelper.setUrlDrawable(view, c.getString(c.getColumnIndex(DataProvider.COL_PICTURE_URL)), R.drawable.no_img);
它在3.0+手机上运行良好,但在旧版本上崩溃了view = null。
有什么工作吗?
答案 0 :(得分:0)
那是因为android.R.id.home
仅在3.0中引入。您必须找到ActionBarSherlock
用来替换它的ID。很可能它会与com.actionbarsherlock.R.id.home
类似,但我会让你自己探索一下。