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条)

报告相同问题?

悬赏问题

  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制
  • ¥20 usb设备兼容性问题
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊
  • ¥15 安装svn网络有问题怎么办
  • ¥15 vue2登录调用后端接口如何实现