当前位置: 代码迷 >> Android >> Button r=new Button(this); 就出错,不知道什么原因?该怎么处理
  详细解决方案

Button r=new Button(this); 就出错,不知道什么原因?该怎么处理

热度:109   发布时间:2016-05-01 22:01:19.0
Button r=new Button(this); 就出错,不知道什么原因?
@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);
   
  }

------解决方案--------------------
探讨

// LoadMainT(MainT,this);
this.setContentView(R.layout.main);
Button r=new Button(this);

颠倒一下顺序应该就没事了
  相关解决方案