Intent loaded URL not responding Android Studio

Multi tool use
Intent loaded URL not responding Android Studio
I am still new to android studio and am trying to load a url when i click a button. However, in the url when I type my username and password, it doesnt go to next page, it just refreshes into the same page.
the codes i used are:
bookingBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent goToWebView = new Intent(getActivity(), WebViewActivity.class);
goToWebView.putExtra("url", "https://www.airbnb.com/");
goToWebView.putExtra("activityTitle", getString(R.string.home_booking_services));
startActivity(goToWebView);
}
})
my WebViewActivity class file would be:
public class WebViewActivity extends AppCompatActivity {
private WebView myWebView;
private LinearLayout errorLayer;
private LinearLayout pBarLayer;
private ProgressBar pBar;
private String url = "";
private String activityTitle = "";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sofia_web_view);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
myWebView = (WebView) findViewById(R.id.webView); // Web view in app
pBarLayer = (LinearLayout) findViewById(R.id.progressBarLayer); // Progress bar layer
pBar = (ProgressBar) findViewById(R.id.progressBar);
errorLayer = (LinearLayout) findViewById(R.id.errorLayer);
pBar.setVisibility(ProgressBar.VISIBLE);
pBarLayer.setVisibility(ProgressBar.VISIBLE);
myWebView.getSettings().setBuiltInZoomControls(true);
myWebView.getSettings().setSupportZoom(true);
myWebView.getSettings().setJavaScriptEnabled(true); // Enable Javascript
myWebView.setWebViewClient(new WebViewClient()); // Open web link inside app
myWebView.setWebChromeClient(new WebChromeClient() {
public void onProgressChanged(WebView view, int progress) {
if (progress < 100 && pBar.getVisibility() == ProgressBar.GONE) {
pBar.setVisibility(ProgressBar.VISIBLE);
pBarLayer.setVisibility(ProgressBar.VISIBLE);
}
pBar.setProgress(progress);
if (progress == 100) {
pBar.setVisibility(ProgressBar.GONE);
pBarLayer.setVisibility(ProgressBar.GONE);
}
}
});
SSLPinningWebViewClient webViewClient = new SSLPinningWebViewClient(new SSLPinningWebViewClient.LoadedListener() {
@Override
public void Loaded(final String url) {
}
@Override
public void PinningPreventedLoading(String host) {
Log.e(host, host);
}
}, WebViewActivity.this);
myWebView.setWebViewClient(webViewClient);
if (getIntent().hasExtra("url")) {
url = getIntent().getStringExtra("url");
if (getIntent().hasExtra("activityTitle"))
activityTitle = getIntent().getStringExtra("activityTitle");
}
setTitle(activityTitle);
myWebView.loadUrl(url);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
switch (id) {
// Respond to the action bar's Up/Home button
case android.R.id.home:
if (myWebView.canGoBack()) {
myWebView.goBack();
} else {
finish();
}
return true;
}
return super.onOptionsItemSelected(item);
}
@Override
public void onBackPressed() {
if (myWebView.canGoBack()) {
myWebView.goBack();
} else {
super.onBackPressed();
}
}
}
Anyone knows why the loaded page arent responding?
If there is any additional information needed, do let me know.TQ
WebViewActivity
@DigvijaysinhGohil have updated the WebViewActivity class file, sorry it may be a bit long, I didnt want to miss out any details, so show the whole file
– William Loke
Jul 1 at 10:13
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Show us your
WebViewActivity
class file, also have you already register that activity in manifest?– Digvijaysinh Gohil
Jul 1 at 9:53