android - Fabric: TwitterSession always null -
i want check if user connected on twitter in order post tweets android application. using fabric, check twittersession
via code:
twittercore twittercore = twittercore.getinstance(); twittersession twittersession = twittercore.getsessionmanager().getactivesession(); return (twittersession != null && !twittersession.getauthtoken().isexpired());
the problem twittersession
null, if i'm connected on twitter application.
how can solve problem?
you have initialize in oncreate firstly. used twitter digits , initilize somthing :
twitterauthconfig authconfig = new twitterauthconfig(twitter_key, twitter_secret); fabric.with(this, new answers(), new twittercore(authconfig), new digits()); strictmode.setthreadpolicy(new strictmode.threadpolicy.builder() .detectall() .penaltylog() .build()); strictmode.setvmpolicy(new strictmode.vmpolicy.builder() .detectall() .penaltylog() .build()); final digits digits = new digits.builder() .withdigitseventlogger(new answerslogger()) .build();
i think @ this page
Comments
Post a Comment