Open blob84 opened 3 years ago
I forgot the type GraphResponse<Storefront.QueryRoot>
.
It works with CompletableFuture
.
If I run the code without CompletableFuture
I get error:
try {
GraphResponse<Storefront.QueryRoot> gresponse = call.execute();
responseData = gresponse.data().getShop().getName();
} catch (GraphError graphError) {
System.out.println("hello qui");
graphError.printStackTrace();
}
error:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.domain.shopifyapp/com.domain.shopifyapp.MainActivity}: android.os.NetworkOnMainThreadException
Let me know if there is a solution better than CompletableFuture
.
Thanks.
Hello this is the code to make a query:
I need that the processed data in the onResponse method should be available outside it. I need to wait (non-blocking) these data and use them in the future elsewhere.
I tried with CompletabeFuture but I get the Storefront.QueryRoot memory address: