@Override
 public void release() {
   super.release();
   if (views != null) {
     for (TiUIView view : views) {
       view.release();
     }
     views = null;
   }
   if (content != null) {
     content.removeAllViews();
     content = null;
   }
   if (hasCheckDrawable != null) {
     hasCheckDrawable.setCallback(null);
     hasCheckDrawable = null;
   }
   if (hasChildDrawable != null) {
     hasChildDrawable.setCallback(null);
     hasChildDrawable = null;
   }
 }
Exemple #2
0
 @Override
 protected void onDestroy() {
   // TODO Auto-generated method stub
   super.onDestroy();
   this.setContentView(R.layout.view_null);
   /////////////////
   BitmapDrawable bd = (BitmapDrawable) allLayout.getBackground();
   allLayout.setBackgroundResource(0); // 别忘了把背景设为null,避免onDraw刷新背景时候出现used a recycled bitmap错误
   bd.setCallback(null);
   bd.getBitmap().recycle();
   allLayout = null;
   /////////////////
   btnPersonal = null;
   btnExpert = null;
   btnMessage = null;
   /////////////////
 }