好的,我有一个public class WebsiteActivity extends AppCompatActivity implements View.OnClickListener {
Button btnActTwo;
//...
private class WebAppInterface {
Context mContext;
WebAppInterface(Context c) {
mContext = c;
}
@JavascriptInterface
public void clickBtnActTwo() {
btnActTwo = (Button) findViewById(R.id.btnActTwo);
btnActTwo.setOnClickListener(WebsiteActivity.this);
Log.e("TEST","TEST");
}
//...
public void onPageFinished(WebView view, String url) {
String javascript = "javascript:"
+ "function onClickBtnActTwo() {Android.clickBtnActTwo();}"
+ "var btnacttwo = document.createElement('div');"
+ "btnacttwo.innerHTML = 'BtnAcTwo text';"
+ "btnacttwo.onclick = onClickBtnActTwo;"
+ "element = document.getElementsByClassName('contentMenu')[0];"
+ "element.appendChild(btnacttwo);"
view.loadUrl(javascript);
//...
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btnActTwo:
Log.e("TEST2","TEST2");
Intent btnActTwoIntent = new Intent(this, BtnActTwoActivity.class);
startActivity(btnActTwoIntent);
break;
//...
方法可以打印出printDocument1_PrintPage
的内容。在执行期间,该方法仅打印出第一页。有人可以帮我打印剩余的页面吗?
我已通过变量ListView
确定了第一页的结尾,并设置了属性ypos
。
e.HasMorePages = true