把TextView轉(zhuǎn)換成Bitmap報(bào)空指針異常
TextView?tv?=?(TextView)?mWaitting.findViewById(R.id.id_age_and_gender); tv.setText(age+""); Log.d("TAG","here"); if(isMale){ ????tv.setCompoundDrawablesWithIntrinsicBounds(getResources().getDrawable(R.drawable.male),null,null,null); }else?{ ????tv.setCompoundDrawablesWithIntrinsicBounds(getResources().getDrawable(R.drawable.female),null,null,null); } tv.setDrawingCacheEnabled(true); Bitmap?bitmap?=?Bitmap.createBitmap(tv.getDrawingCache()); tv.destroyDrawingCache(); return?bitmap;
Bitmap bitmap = Bitmap.createBitmap(tv.getDrawingCache());這個(gè)位置報(bào)空指針異常,怎么辦
2016-06-27
是自己在解析的時(shí)候沒有用把mWaitting設(shè)置為可見,問題已經(jīng)解決了