Answer the question
In order to leave comments, you need to log in
How to get the value of a json file in a class in Android Studio that is on the network?
There is a class:
package com.example.app;
import android.content.Intent;
import android.net.Uri;
import android.webkit.WebView;
import android.webkit.WebViewClient;
class MyWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
Uri uri = Uri.parse(url);
if (uri.getHost() != null && uri.getHost().contains("example.com")) {
return false;
}
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
view.getContext().startActivity(intent);
return true;
}
}
[ {
"id": 1569,
"link": "https://site.com"
} ]
Answer the question
In order to leave comments, you need to log in
Check out retrofit:
https://square.github.io/retrofit/
About data:
String s = "example.com/link#data";
String data = s.substring(s.indexOf("#")+1);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question