-1

See this code for Webview - Webview.java

public class webView extends AppCompatActivity {
public WebView webView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_web_view);
        webView = (WebView)findViewById(R.id.webview);
        webView.setWebViewClient(new WebViewClient());
        webView.loadUrl("https://ewaybillgst.gov.in/Account/EWBUserRegistration.aspx");
    }
}

Webview.xml

 <WebView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:layout_editor_absoluteX="8dp"
        tools:layout_editor_absoluteY="8dp"
        android:id="@+id/webview"
        />

Please Tell Me, how to load this URL entirely inside phone's screen so that it doesn't move outside. See this screenshot of phone's screen - webview is moving to right side of phone's screen so we have to drag it to see whats on the right side

I want that this page doesn't move outside the phone's screen..

Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141
  • 3
    The web page itself is not responsive... It's actually a mess, the CSS is a good example of bad practices from 15 years ago. – 2Dee Jun 22 '18 at 08:50
  • It can't be done. But you can change the problem and solve the changed problem... I suggest that you open the web page in a narrow browser window and open the Chrome/Firefox tools, then edit the CSS until the page fits. In this case removing a single "width: 650px" seems sufficient but I'd probably remove the "150px" too. Once you know what CSS to change, you can easily modify the page between loading it and providing it to the webview. There's a library called jsoup that's perfect for loading HTML, modifying it, and then giving the result to WebView. – arnt Jun 22 '18 at 10:19

1 Answers1

0

try

   webView.getSettings().setLoadWithOverviewMode(true);  //loads the WebView completely zoomed out