1、android TextView加载html 解决a标签链接无效
关键在于setMovementMethod
tv_test.setText(charSequence);
tv_test.setClickable(true);
tv_test.setMovementMethod(LinkMovementMethod.getInstance());
2、popupWindow show()方法报错
Unable to add window --token null is not valid; is your activity running?
解决方案:开线程或者在onWindowFocusChanged方法中show(推荐开线程)
guide_viewpager.post(new Runnable() {
@Override
public void run() {
mPopupWindow.showAtLocation(guide_viewpager, Gravity.CENTER, 0, 0);
}
});
3、popupwWindow的使用:
mView = LayoutInflater.from(this).inflate(R.layout.layout_pop_privocy, null, false);
mPopupWindow = new PopupWindow(mView, LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT, true);
mPopupWindow.setOutsideTouchable(false);
mPopupWindow.setBackgroundDrawable(new BitmapDrawable(getResources(), (Bitmap) null));
mPopupWindow.showAtLocation(guide_viewpager, Gravity.CENTER, 0, 0);