package com.example.example2;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.WebView;
import android.widget.Button;
public class MainActivity extends Activity {
WebView web1;
WebView web2;
Button btn;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final String str1 = "<html>This first Html data</html>";
final String str2 = "<br /><br />Read the handouts please for tomorrow.<br /><br /><!--homework help homework"
+ "help help with homework homework assignments elementary school high school middle school"
+ "// --><font color='#60c000' size='4'><strong>Please!</strong></font>"
+ "<img src='http://www.homeworknow.com/hwnow/upload/images/tn_star300.gif' />";
web1 = (WebView) findViewById(R.id.webfirst);
web2 = (WebView) findViewById(R.id.websecond);
btn = (Button) findViewById(R.id.compare);
btn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
web1.loadDataWithBaseURL("", str1, "text/html", "UTF-8", "");
web2.loadDataWithBaseURL("", str2, "text/html", "UTF-8", "");
// we have display This on Alert view with spliting .
}
});
}
}
这是我的拆分视图活动,当我单击按钮时,我们能够通过拆分活动在 Web 视图中查看数据但是当我单击按钮时,我必须这样做,然后字符串 1 和字符串 2 应该显示在同一活动中的弹出窗口中并拆分数据如何在android中拆分警报或弹出视图请帮助我无法做到这一点我已经很累但不知道我会怎么做