K
K
Krasavchik262020-05-04 21:43:07
Java
Krasavchik26, 2020-05-04 21:43:07

Why doesn't attaching files work in my created android browser?

I created a simple browser in Android Studio in Java, and through it, if you go to Vkontakte or chat Bro and click on send a file, then for some reason it does not open the gallery, or the camera, or anything. Although Java scripts connected everything. Perhaps you need to give some more permission?

@Override
protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);
setContentView(R.layout.besedka_layout);
if (getSupportActionBar() != null);

web = findViewById(R.id.webView);
WebSettings ws = web.getSettings();
ws.setJavaScriptEnabled(true);
web.loadUrl(" https://pubglite.chatbro.com ");
web.getSettings().setDomStorageEnabled(true);
web.setWebViewClient(new MyWebViewClient());
}

private class MyWebViewClient extends WebViewClient {
@Override public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
return super.shouldOverrideUrlLoading(view, request);
}

@Override public void onPageFinished(WebView view, String url) {
}

@Override
public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {
super.onReceivedError(view, request, error);
}
}

@Override
public void onBackPressed() {
if (web.canGoBack())
web.goBack();
else
super.onBackPressed();

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question