I have button.Onclicking button it cals->choose Browser->on choosing Browser it loads my Url.
on coming back from browser,all my previous locally set variable value are cleared.Variables have have values that are initialized with them.
for ex:
i=0.
inside method i assign i=10
call browser now //
i use this code to call browser
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(strUrl));
intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
startActivity(Intent.createChooser(intent, "Choose browser"));
it loads Url//
now on coming back to activity
Varialble (i) value becomes 0.
You need to understand the lifecycle of an Activity a little better. When you leave and return from an Activity state is not automatically persisted.
Android Lifecycle: http://developer.android.com/training/basics/activity-lifecycle/index.html
You should use onSavedInstanceState to restore your state when you return to your Activity. This is the code example the (linked) docs give: