Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class App63 extends Application
- {
- private static Api63 api63;
- private Retrofit retrofit;
- @Override
- public void onCreate() {
- super.onCreate();
- retrofit = new Retrofit.Builder().baseUrl("http://www.chat.pareto-marketing.ru/").addConverterFactory(GsonConverterFactory.create()).build();
- api63 = retrofit.create(Api63.class);
- }
- public static Api63 getApi() {
- return api63;
- }
- }
- public interface Api63
- {
- @GET("getform")
- Call<ResponseBody> getData();
- }
- Call<ResponseBody> list = App63.getApi().getData();
- list.enqueue(new Callback<ResponseBody>() {
- @Override
- public void onResponse(Call<ResponseBody> p1, Response<ResponseBody> p2)
- {
- try
- {
- Log.d("$", p2.body().string());
- }
- catch (IOException e)
- {}
- }
- @Override
- public void onFailure(Call<ResponseBody> p1, Throwable p2)
- {
- // TODO: Implement this method
- }
- });
- }
- }
- java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String okhttp3.ResponseBody.string()' on a null object reference
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement