I have 2 activity
- Tranning Activity
- Question Activity
i have set one integer variable in question activity like :: int a=0;at the end of activity i jump from Question part to Training part.i call from question part to training part 5 time.But confusion is that how can i increment "a" variable each time while Question part call?
Is it possible by this?
if(yes)
{
how ?
}
else if(no)
{
any other Option are there? how?
}
Update ::
confusion ?
let me explain
If it should be incremented only for the current run, you can use a
staticfield, and increment it inonCreate(), oronResume(). if it should be incremented even when the application is restarted, you might want to useSharedPreferences.