按两次退出程序and改变不同字体颜色编辑and设置不同字体大小

private long mAppExitTime;  //退出应用时间
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
    if (keyCode == KeyEvent.KEYCODE_BACK) {
        if (ViewUtils.getViewVisibility(flApply)) {
            hindApplyView();
            return true;
        } else if ((TimeUtils.getCurrentTimeInLong() - mAppExitTime) > 2000) {
            ToastUtils.show(HomeActivity2.this, R.string.txt_home_toast_1);
            mAppExitTime = TimeUtils.getCurrentTimeInLong();
            return true;
        }

        finish();
    }
    return super.onKeyDown(keyCode, event);
}

//改变不同字体颜色编辑

Html.fromHtml("<font color='#AE385F" + "'>" + commentatorValue + "</font>" + " 回复 " + "<font color='#AE385F" + "'>" + issuer + "</font>");

//设置不同字体大小

https://blog.csdn.net/qq_32320807/article/details/82497882

String str2 = "<font><small><small>¥</small></small></font><font><big>39</big></font><font><small><small>.00</small></small></font>";
原创文章 63 获赞 7 访问量 6257

猜你喜欢

转载自blog.csdn.net/weixin_42416789/article/details/102936346
今日推荐