我知道为什么会出现OutOfMemoryError异常.但是有任何最好的方法将字节数组转换为Bitmap.And我使用下面的代码,但是当大字节时它强制关闭app并给出OutOfMemoryError Exception.
我有API它只是返回字节数组没有别的.
Bitmap bmp = BitmapFactory.decodeByteArray(bytearray, 0, bytearray.length);
Run Code Online (Sandbox Code Playgroud) 昨天,我在一次关于多态性的采访中被问到一个问题......
关于多态性,哪些陈述是正确的?
- 多态性是一种类可以以多种形式存在的方法.
- 多态性是一种类只能以两种形式存在的方法.
- 多态性是一种方法,其中对象的不同实例显示不同的行为
- 多态性是一种方法,其中对象的不同实例显示相同的行为
我有下面的代码,不能检查是否有条件......我怎么解决?
@Override
protected void onPostExecute(Void result) {
if (null != pDialog && pDialog.isShowing()); {
pDialog.dismiss();
}
if (null == arrayList || arrayList.size() == 0) {
showToast("No data found from web!!!");
MainActivity.this.finish();
} else {
Collections.sort(arrayList);
setAdapterToListview(arrayList);
}
super.onPostExecute(result);
}
Run Code Online (Sandbox Code Playgroud)