RobYost Posted November 10, 2017 Share Posted November 10, 2017 on my mobile app I have two menu items 1. Go to Full Site UniSession.UrlRedirect(URL); 2. Logout (Which takes you to the login screen) UniApplication.Restart; Both of these work correctly on my phone while in a browser. But when I created an android app that only has one component on it, a WebView <WebView android:id="@+id/activity_main_webview" android:layout_width="fill_parent" android:layout_height="fill_parent" /> They do nothing when clicked. I don't really know how WebView works, but it looks like I need to send something different to WebView to get it redirect. Quote Link to comment Share on other sites More sharing options...
RobYost Posted November 10, 2017 Author Share Posted November 10, 2017 Add the two lines to MainActivity.java package com.simple_landlord.simplelandlord; import android.support.v7.app.ActionBarActivity; import android.os.Bundle; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; <====Add this line public class MainActivity extends ActionBarActivity { private WebView mWebView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mWebView = (WebView) findViewById(R.id.activity_main_webview); WebSettings webSettings = mWebView.getSettings(); mWebView.setInitialScale(1); mWebView.getSettings().setLoadWithOverviewMode(true); mWebView.getSettings().setUseWideViewPort(true); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.setWebViewClient(new WebViewClient()); <====Add this line mWebView.loadUrl("https://secure.simple-landlord.com/m"); } } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.