I will check it and reply on github
Amit Shekhar
1

I am continuously getting error

com.androidnetworking.error.ANError: java.lang.NullPointerException: Attempt to invoke virtual method ‘okhttp3.HttpUrl$Builder okhttp3.HttpUrl.newBuilder()’ on a null object reference

My Code:

OkHttpClient okHttpClient = new OkHttpClient().newBuilder()
.connectTimeout(120, TimeUnit.SECONDS)
.readTimeout(120, TimeUnit.SECONDS)
. writeTimeout(120, TimeUnit.SECONDS)
.build();
AndroidNetworking.initialize(getActivity(),okHttpClient);
AndroidNetworking.post(WebUrls.CLIENT_GET_RATING_REVIEWS)
.addBodyParameter("user_id", new SessionManager(getActivity()).getUserID())
.addBodyParameter("lang", new SessionManager(getActivity()).getUserLANG())
.addBodyParameter("celebrity_code", text)
.addBodyParameter("device_id", Settings.Secure.getString(getContext().getContentResolver(), Settings.Secure.ANDROID_ID))
.setTag("test")
.setPriority(Priority.MEDIUM)
.setOkHttpClient(okHttpClient)
.build()
.getAsJSONObject(new JSONObjectRequestListener() {
@Override
public void onResponse(JSONObject response) {
long elapsedTime2 = System.currentTimeMillis() - startTime;
Log.d("elapsedTime2", elapsedTime2 + "");
}

@Override
public void onError(ANError error) {
Toast.makeText(getActivity(), "dlfsdjf", Toast.LENGTH_SHORT).show();
}
});
=====================================================
Always going to onError
Like what you read? Give salmam Khan a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.