Sorry. Yes. You are right. onCreate runs first, then onResume next. (I
am still learning about Android activity cycle :-)
Here is my onResume method that handle this data that comes from
Twitter.
See lines 5 and 6. If 6 is true I am extracting token and secret and
saving them to SharedPreferences. This code runs fine, just that RowID
variable gets lost in the process. onCreate that runs before this one
(onResume), has no idea about RowID.
@Override
protected void onResume() {
super.onResume();
Log.d(TAG, "mRowID onResume : " + mRowId);
Uri uri = this.getIntent().getData();
if (uri != null && uri.toString().startsWith(CALLBACK_URL)) {
SessionPilot appState =
((SessionPilot)getApplicationContext());
consumer = appState.getConsumer();
provider = appState.getProvider();
String verifier =
uri.getQueryParameter(oauth.signpost.OAuth.OAUTH_VERIFIER);
try {
provider.retrieveAccessToken(consumer, verifier);
Utils.StoreStringToPrefs("twitterToken",
consumer.getToken(), PREF_FILE_NAME ,this);
Utils.StoreStringToPrefs("twitterSecret",
consumer.getTokenSecret(), PREF_FILE_NAME ,this);
} catch (Exception e) {
Log.e(APP, e.getMessage());
}
}
}
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en