1. AC Question's Avatar
    I build an android app using Android Studio for my website. I build an Webview and i have 1 little problem. When i press share button from website like Facebook Share login work ok, i press share button but after share is complete i see just a white page.

    Here is my main.java

    package totalonlinesrl.noiinbucatarie;

    import android.content.Intent;
    import android.net.Uri;
    import android.support.v7.app.AppCompatActivity;
    import android.os.Bundle;
    import android.view.KeyEvent;
    import android.view.Window;
    import android.view.WindowManager;
    import android.webkit.URLUtil;
    import android.webkit.WebSettings;
    import android.webkit.WebView;
    import android.webkit.WebViewClient;

    public class MainActivity extends AppCompatActivity {

    private WebView webView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    this.requestWindowFeature(Window.FEATURE_NO_TITLE);
    this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

    setContentView(R.layout.activity_main);

    webView = (WebView) findViewById(R.id.webView);
    WebSettings webSettings = webView.getSettings();
    webSettings.setJavaScriptEnabled(true);
    webSettings.setRenderPriority(WebSettings.RenderPriority.HIGH);
    webView.loadUrl("websiteurl");
    webView.setWebViewClient(new WebViewClient() {
    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url) {
    if( URLUtil.isNetworkUrl(url) ) {
    return false;
    }

    Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
    startActivity( intent );
    return true;
    }

    });
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
    if (event.getAction() == KeyEvent.ACTION_DOWN) {
    switch (keyCode) {
    case KeyEvent.KEYCODE_BACK:
    if (webView.canGoBack()) {
    webView.goBack();
    } else {
    finish();
    }
    case KeyEvent.KEYCODE_MENU:
    webView.loadUrl("javascript:open_menu()");
    return true;
    }

    }
    return super.onKeyDown(keyCode, event);
    }

    }
    12-28-2016 05:49 PM
  2. ManiacJoe's Avatar
    You will have better luck for an answer if you create an account then repost the question in the developers forum.
    12-28-2016 10:07 PM

Similar Threads

  1. Android isn't starting
    By Mare Cyrano in forum Ask a Question
    Replies: 3
    Last Post: 01-09-2017, 07:18 PM
  2. Problem updating from Android 5.0.4
    By AC Question in forum Ask a Question
    Replies: 2
    Last Post: 12-29-2016, 11:51 AM
  3. Why won't my games apps send lives anymore?
    By AC Question in forum Ask a Question
    Replies: 0
    Last Post: 12-28-2016, 05:39 PM
  4. Replies: 3
    Last Post: 12-28-2016, 04:21 PM
  5. Nova App launcher
    By newtda513 in forum Android Apps
    Replies: 3
    Last Post: 12-28-2016, 03:34 PM
LINK TO POST COPIED TO CLIPBOARD