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 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同
  • ¥50 如何openEuler 22.03上安装配置drbd
  • ¥20 ING91680C BLE5.3 芯片怎么实现串口收发数据
  • ¥15 无线连接树莓派,无法执行update,如何解决?(相关搜索:软件下载)
  • ¥15 Windows11, backspace, enter, space键失灵