嗨,我有一个自定义视图,该视图具有两个用于显示某些textViews的功能。 现在,当我第一次运行该活动时,它运行良好,但是当我单击“后退”按钮并再次转到包含自定义视图的活动时,功能将无法执行。
我按下后试图完成活动 我试图在onResume和onRestart中再次调用那些函数
包含自定义视图的活动:
WordgameCustomView cv;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_wordgame_link_word);
cv = findViewById(R.id.cv);
cv.setInput("د", "ب", "آ", "ک", "ک", "ک");
cv.setTopTvs(new String[]{"آب","آهو"});
}
public void onToolbarClick(View v) {
switch (v.getId()) {
case R.id.wordgame_btn_back:
finish();
startActivity(new Intent(getApplicationContext(), MakeWordsGameActivity.class));
break;
case R.id.wordgame_btn_refresh:
Toast.makeText(getApplicationContext(), "refresh clicked", Toast.LENGTH_SHORT).show();
break;
case R.id.wordgame_btn_setting:
Toast.makeText(getApplicationContext(), "setting clicked", Toast.LENGTH_SHORT).show();
break;
}
}