WebView App + Printing

0

I created an APP that opens a website where I log in, so I fill in a spreadsheet at the end by Google Chrome it generates a print command (I can choose to save or print).

In my app I do everything when I finish the form asks to open Google Chrome and I have to do everything again by the browser, does anyone have a solution to generate a print command or generate PDF?

 public class MainActivity extends AppCompatActivity {

    WebView wv;
    String mypage = "http://www.refimat.com.br/5Tabelas.html";



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        wv = (WebView) findViewById(R.id.wv);

        wv.setWebChromeClient(new WebChromeClient());
        wv.getSettings().setJavaScriptEnabled(true);
        wv.setFocusable(true);
        wv.getSettings().setRenderPriority(WebSettings.RenderPriority.HIGH);
        wv.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
        wv.getSettings().setDomStorageEnabled(true);
        wv.getSettings().setDatabaseEnabled(true);
        wv.getSettings().setAppCacheEnabled(true);
        wv.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
        wv.loadUrl(mypage);
    }
}

.xml code

<?xml version="1.0" encoding="utf-8"?>

<WebView
    android:id="@+id/wv"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    tools:ignore="MissingConstraints" />

    
asked by anonymous 05.09.2017 / 02:04

0 answers