请帮助我找到解决问题的方法-
我已实现了回收站视图,在该视图上单击该项目将打开一个警报对话框,其中包含Web视图,其中已解析HTML数据。对于有时滚动,我注意到“警报对话框”闪烁。我不知道到底是什么。
预先感谢!
这是我编写的代码的一瞥-
if(message.getCONTENT_TYPE().equals("HTML"))
{ //holder.setIsRecyclable(false);
webView= new WebView(context);
String Text="HTML Content, "+"Click to open!";
holder.messageView.setText(Text);
if(message.getMESSAGE_TYPE() == TYPE_SENT){
holder.messageView.setBackgroundResource(R.drawable.balloon_html_sent);
holder.item.setGravity(Gravity.END);
holder.messageView.setTextColor(holder.messageView.getResources().getColor(R.color.white));
holder.messageView.setTypeface(null, Typeface.BOLD);
}else if(message.getMESSAGE_TYPE() == TYPE_REC){
holder.messageView.setBackgroundResource(R.drawable.balloon_html_received);
holder.item.setGravity(Gravity.START);
holder.messageView.setTextColor(holder.messageView.getResources().getColor(R.color.white));
holder.messageView.setTypeface(null, Typeface.BOLD);
}else {
holder.messageView.setBackgroundResource(R.drawable.balloon_html_mid);
holder.item.setGravity(Gravity.CENTER_HORIZONTAL);
holder.messageView.setTextColor(holder.messageView.getResources().getColor(R.color.white));
holder.messageView.setTypeface(null, Typeface.BOLD_ITALIC);
}
holder.messageView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
AlertDialog.Builder builder=new AlertDialog.Builder(context,R.style.CustomAlertDialog);
LinearLayout wrapper = new LinearLayout(context);
WebView webView = new WebView(context);
EditText keyboardHack = new EditText(context);
keyboardHack.setVisibility(View.GONE);
webView.loadData(message.getCONTENT(), "text/html", "utf-8");
wrapper.setOrientation(LinearLayout.VERTICAL);
wrapper.addView(webView, LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT);
wrapper.addView(keyboardHack, LinearLayout
.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
if(wrapper.getParent() != null) {
((ViewGroup)wrapper.getParent()).removeView(wrapper);
}
builder.setView(wrapper);
builder.create().show();
}
});
}