@Override
    public void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
    
    
    
     //TableLayout MainT =(TableLayout) this.findViewById(R.id.MainT);
     Button r=new Button(this);
    
    // LoadMainT(MainT,this);
     this.setContentView(R.layout.main);
      
    }

解决方案 »

  1.   

     // LoadMainT(MainT,this);
      this.setContentView(R.layout.main);
    Button r=new Button(this);
     
     颠倒一下顺序应该就没事了
      

  2.   


    顺便说下:
    1,顺序要颠倒下
    2,你定义的这个button感觉不能显示出来啊,还要把它加到context中才能用吧。
      

  3.   

    明白了。。顺序试过,颠倒不颠倒也一样。。是我的IDE环境配置有问题,解决了。