Search code examples
javaandroidpodio

podio: withResultListener compile time error in android


I try to build an android application to integrate with podio and get details from my podio account. while using the code

  Podio.client.authenticateWithUserCredentials(usr, pwd)
        withResultListener(new ResultListener<Session>() {

            @Override
            public boolean onRequestPerformed(Session session) {
                // Yeay!
                return false;
            }

        });

it shows the compile time error such as

"The method withResultListener(new ResultListener(){}) is undefined for the type "


Solution

  • I noticed you're missing a dot (.) before the withResultListener call. I'm not sure if this is a mistake made while formatting the question. If not, it may be the reason for your issue.

    The other thing is that there has recently been some changes to the Podio Android SDK which brake the (beta) API of it. The session content is from now on delivered through the SessionListener callback. It should all work if you change your code to look something like below.

    Podio.client.authenticateWithUserCredentials(usr, pwd)
        .withSessionListener(new SessionListener() {
    
            @Override
            public boolean onSessionChanged(String authToken, String refreshToken, long expires) {
                // Yeay!
                return false;
            }
    
        });
    

    I hope this helps you solve your issue.

    DISCLAIMER: I'm a software developer at Citrix, Podio.