-3

I want loading site in webview but when using , not showing. I want loading this site web.rubika.ir in webview and send requests. How do I do this? Only this site .

Md Md
  • 1
  • 1

2 Answers2

1

You can use this to load a url in your webView

webView.loadUrl("Your URL Here")

additionally if you want to get notified whether your url is still loading or finished you can have a look at this get notified when webview loaded.

You can show a progress bar while loading url which will help to understand that web view is loading.

Mohammed Hanif.
  • 950
  • 1
  • 3
  • 16
  • I did all that said. But it did not work. I do not know, maybe the site is unique so that it can not be opened with webview. You can do a test and tell me the result. – Md Md Sep 01 '20 at 00:26
0
  1. in layout file (.xml) of this activity, use webview widget

     <WebView
     android:id="@+id/webview"
     android:layout_width="match_parent"
     android:layout_height="match_parent"/>
    
  2. Then in onCreate method of the activity, use webview.

     WebView wv;
     wv = findViewById(R.id.webview);
     wv.loadUrl("web.rubika.ir");
    
  3. If you want to enable javascript support

     WebSettings webSettings = wv.getSettings();
     webSettings.setJavaScriptEnabled(true);
    
  4. Make sure you have declared Internet permission in manifest.xml

     <uses-permission android:name="android.permission.INTERNET" />
    
  5. then in Application tag of you manifest add this;

     <application
         android:usesCleartextTraffic="true"
    

6.Done.

dani3264
  • 11
  • 4
  • Tx @dani3264 .I did all that said. But it did not work. I do not know, maybe the site is unique so that it can not be opened with webview. You can do a test and tell me the result. – Md Md Sep 01 '20 at 00:26