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 vue3+express部署到nginx
  • ¥20 搭建pt1000三线制高精度测温电路
  • ¥15 使用Jdk8自带的算法,和Jdk11自带的加密结果会一样吗,不一样的话有什么解决方案,Jdk不能升级的情况
  • ¥15 画两个图 python或R
  • ¥15 在线请求openmv与pixhawk 实现实时目标跟踪的具体通讯方法
  • ¥15 八路抢答器设计出现故障
  • ¥15 opencv 无法读取视频
  • ¥15 按键修改电子时钟,C51单片机
  • ¥60 Java中实现如何实现张量类,并用于图像处理(不运用其他科学计算库和图像处理库))
  • ¥20 5037端口被adb自己占了