Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

Callback triggers failure() resulting in a blank screen when I run the app

I have completed the first two stages of Google-Play-Services course, but when I run the app I get a blank screen, due to failure() being called instead of success() in the ListingAdapter.java class. I have tested my API key in the browser, and reviewed my Etsy.java class for any typo's with the endpoint and related methods, and tried reversing the "Images,Shop" includes String in getActivityListings as suggested in another question.

What else could be causing failure() to be called?

    private static RequestInterceptor getInterceptor(){
        return new RequestInterceptor() {
            @Override
            public void intercept(RequestFacade request) {
                request.addEncodedQueryParam("api_key", API_KEY);
            }
        };
    }

    private static Api getApi(){
        return new RestAdapter.Builder()
                .setEndpoint("https://www.openapi.etsy.com/v2")
                .setRequestInterceptor(getInterceptor())
                .build()
                .create(Api.class);
    }

    public static void getActiveListings(Callback<ActiveListings> callback){
        getApi().activeListings("Shop,Images", callback);
    }