开发者

onSaveInstanceState problem while making oAuth request

Here is my scenario:

1) in my activity, user pushes Authorize button.

2) app opens WebView, in which Twitter page is loaded and user is asked to enter login and password and press Allow button. (oAuth implementation, Twitter requires it in order to integrate your app with Twitter)

3) Remote server passes Intent with Token and Secret back to my Activity, and my Activity then gets control back.

My Problem:

When 开发者_开发问答starting this activity, through Intent, RowID variable is passed. This value I save in onSavedInstanceState when activity is pausing or when screen orientation is changed. In step 3, when my activity receives control back I loose this RowID variable. I can see why, basically activity is doing onResume and receiving intent from Twitter where there is no mention of RowID. So, how can I save my RowID value and retrieve it when activity is resumed? I could save it to Preferences, but is that right thing to do?

Any suggestions, Thanks.


Preferences is the correct way to save state for such cases. simple, easy quick.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜