When I put this link:
What is a web that allows you to update the online text in my application without having to edit the App.
But I always get an error: "We are trying to connect to the server." if I use for example Google if it works and other webs but that in particular does not, why is it? I'm also interested in another option for what I want to do.
My code:
public class MainActivity extends AppCompatActivity {
private WebView view;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
view = (WebView) this.findViewById(R.id.prueba);
view.getSettings().setJavaScriptEnabled(true);
view.setWebViewClient(new MyBrowser());
view.loadUrl("http://www.writeurl.com/text/hc2m5gy29z0byqvo53ug/38nftxs4azvgifrbq6m9");
view.setWebChromeClient(new WebChromeClient());
}
private class MyBrowser extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
}
public boolean onKeyDown(int keyCode, KeyEvent event) {
if ((keyCode == KeyEvent.KEYCODE_BACK) && view.canGoBack()) {
view.goBack();
return true;
}
return super.onKeyDown(keyCode, event);
}
}