当我尝试从 onCreate 调用函数时,应用程序停止工作。我要做的就是在活动加载时更改 textview 中的文本。帮助?
public class BellSchedules extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_bell_schedules);
BellSch(null);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.bell_schedules, menu);
return true;
}
public void BellSch(View view)
{
TextView bells = (TextView) findViewById(R.id.textView1);
int date = (Calendar.DAY_OF_WEEK);
String realDate = getString(date);
//bells.setText(realDate);
bells.setText("huehuehuehuehue");
}