开发者

Calling on onDestroy() method in my Expandable list Activity

My AndroidApp containing 5 classes in that 4 activities are normal activities and one activity is ExpandableListActivity ,for the 4 activities am using onDestroy() method and am using below code

@Override
protected void onDestroy() {
    // TODO Auto-generated method stub
    super.onDestroy();
    unbindDrawables(findViewById("AM using layout id"));  
System.gc();
}

      private void unbindDrawables(View view) {
    if (view.getBackground() != null) {
    view.getBackground().setCallback(null);
    }
    if (view instanceof ViewGroup) {
        for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {
        unbindDrawables(((ViewGroup) view).getChildAt(i));
        }
    ((ViewGroup) view).removeAllViews();
    }
   }

now i want to apply same code for expandablelistactivity class but the problem is am not using any layout ( setContentView(R.layout.ans);) am using below code

public class Mainactivity extends ExpandableListActivity  {

 public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInsta开发者_开发技巧nceState);

   // setContentView(R.layout.layout); but am not writing this line

  setListAdapter("adapter am calling");
    }

and my doubt is how can i implement onDestroy() method as same as above in this class..

please provide any code for that..thanking you

T&R Rajinikanth M


Exactly the same way as you are doing in the first example.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜