x66ccff 2016-05-10 14:23 采纳率: 57.1%
浏览 1571
已采纳

android onCreate 加载问题

@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
super.onResume();
et = (EditText)findViewById(R.id.et);
etR = (EditText)findViewById(R.id.etR);
tv1= (TextView)findViewById(R.id.swclOnClickButton);
tv2= (TextView)findViewById(R.id.tv2);
btSin=(Button)findViewById(R.id.ButtonSin);
btCos=(Button)findViewById(R.id.ButtonCos);
btTan=(Button)findViewById(R.id.ButtonTan);
btLn=(Button)findViewById(R.id.ButtonLn);
btLog=(Button)findViewById(R.id.ButtonLog);
btSqr=(Button)findViewById(R.id.ButtonSqr);
btRot=(Button)findViewById(R.id.ButtonRot);
btMun=(Button)findViewById(R.id.ButtonMun);
btFa=(Button)findViewById(R.id.FaButton);
et.addTextChangedListener(textWatcher);
}

在初始化的时候要加载很多东西,放在这样放在onCreate里面对吗?应该怎么改?

  • 写回答

4条回答 默认 最新

  • danielinbiti 2016-05-10 14:26
    关注
     onCreate里面为什么要super.onResume();这句不要。
     其他没什么问题
     另外textWatcher这个变量没定义
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?