源自:6-1 UI实现
onBackPressed()方法为什么直接退出了APP
protected void initNavBar(boolean isShowBack, String title, boolean isShowMine) {
mTvBack = fd(R.id.iv_back);
mTvMine = fd(R.id.iv_mine);
mTvTitle = fd(R.id.tv_title);
mTvBack.setVisibility(isShowBack ? View.VISIBLE : View.GONE);
mTvMine.setVisibility(isShowMine ? View.VISIBLE : View.GONE);
mTvTitle.setText(title);
mTvBack.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
L.d("on back 调用onBackPressed方法回到上一个页面");
}
});
}
提问者:muang
2020-10-10 20:20