gpt4 book ai didi

java - 错误: reached end of file while parsing

转载 作者:太空宇宙 更新时间:2023-11-04 13:31:43 28 4
gpt4 key购买 nike

我目前正在使用 Android Studio。我在编译文件时遇到问题。我一直收到这个错误。我搜索了类似的问题,但对我没有帮助。

私有(private) void queryBooks(String searchString) {

    // Prepare your search string to be put in a URL
// It might have reserved characters or something
String urlString = "";
try {
urlString = URLEncoder.encode(searchString, "UTF-8");
} catch (UnsupportedEncodingException e) {

// if this fails for some reason, let the user know why
e.printStackTrace();
Toast.makeText(this, "Error: " + e.getMessage(), Toast.LENGTH_LONG).show();
}

// Create a client to perform networking
AsyncHttpClient client = new AsyncHttpClient();

// Have the client get a JSONArray of data
// and define how to respond
client.get(QUERY_URL + urlString,
new JsonHttpResponseHandler() {

@Override
public void onSuccess(JSONObject jsonObject) {
// Display a "Toast" message
// to announce your success
Toast.makeText(getApplicationContext(), "Success!", Toast.LENGTH_LONG).show();

// 8. For now, just log results
Log.d("omg android", jsonObject.toString());
}

@Override
public void onFailure(int statusCode, Throwable throwable, JSONObject error) {

// Display a "Toast" message
// to announce the failure
Toast.makeText(getApplicationContext(), "Error: " + statusCode + " " + throwable.getMessage(), Toast.LENGTH_LONG).show();

// Log error message
// to help solve any problems
Log.e("omg android", statusCode + " " + throwable.getMessage());
}
}

最佳答案

调试我的程序后。我找到了答案。我失踪了});在关闭我的程序之前。谢谢大家对我的帮助。

关于java - 错误: reached end of file while parsing,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32130480/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com