Webview + Print App

Asked

Viewed 131 times

0

I created an APP that opens a site where I log in, so I fill 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 finalizing the form asks to open Google Chrome and I have to do everything again by browser, someone has 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);
    }
}

Code . xml

<?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" />

  • Welcome, I could talk a little more about your problem, I believe I was a little confused the second part.

  • Good evening friend, I have a site and created an App in a simple way with only a Webview entering directly on the site, so I log in to it and fill a registration as a test and the App does not generate to the printing as the normal Google Chrome does, it opens the site again by a browser in the login part. So I would like a help to make a direct print command in the App.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.