URL から文字列 a にデータを取得し、この文字列を引数として gson の fromJson メソッドに渡します。ここで、文字列 a の一部の部分文字列を置き換える必要があります。
String url = "abc";
String a = getDataFromURL(url); //this string contains all the data from the URL, and getDataFromURL is the method that reads the data from the URL.
String tmp = "\"reservation\":\"www.\"";
String tmpWithHttp = "\"reservation\":\"http://www.\"";
if(a.contains(tmp))
{
a = a.replace(a, tmpWithHttp);
}
URL 内のすべてのデータは JSON です。ここでの要件は、文字列 a に部分文字列 - が含まれている場合、それを次のよう"reservation":"www.
に置き換えることです。"reservation":"http://www.
私が持っている上記のコードは機能していません。誰かがここで私を助けてくれませんか?