Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6359151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:28:50+00:00 2026-05-24T23:28:50+00:00

I have a question related to navigation between different activities and onPause and onRestore

  • 0

I have a question related to navigation between different activities and onPause and onRestore might solve the problem but how that I don’t know.

The problem is
I have following screens in my application

  1. HomeActivity – This is the welcome screen
  2. CategoryActivity – Here there are three categories e.g. Animal, Plants and Fruits.
  3. QuestionsActivity – Here each questions are available according to selection of Category. In each cateogry there are 50 questions.The application has multiple choice type of questions.

so the flow of application is when a user comes and selects a category, I populate an arraylist of 50 questions from my xml for that category, then display those questions one by one on the QuestionActivity screen.
Here, every time a user clicks on the category, I shuffle the arraylist
and show the count. i.e you finished 1 question, you finished 2 question etcs.

So this is something about my application and now problem:

Suppose a user is in QuestionActivty and he answered 5 questions and then click on back button of mobile so he is redirected to the CategoryActivity screen. Now from here, if he again clicks on the same Category, he is redirected to the QuestionActivity screen but his questions starts from 1st questions :(. Ideally, it should start with 6th question as he already aswered 5 questions.

Can some one please help me to solve this problem? If I persist the count, then it won’t work for me as every time I am shuffling the arraylist (so the answered questions might repeat.)
What the ideal solution should be is to let android manage the state of QuestionActivity at the time of click of back button and resume the same state at the time of again selecting the same Category

This must be a common problem so if you already solved it, please help me out.

Thanks a lot in advance,
Ishan

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T23:28:51+00:00Added an answer on May 24, 2026 at 11:28 pm

    Why not use StartActivityForResult(). Send back an int x = 5 back to CategoryActivity and then when you resume QuestionActivity you can send x back with it in the Bundle extras. SO then QuestionActivity knows to start form the 6th (x+1) question.

    If the questions are randomly ordered you will have problems, since the 6th question might be the same as the first five. So instead of sending just an int x back, send an Integer Array of the question numbers that have already been answered.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question related to this one . I don't want to do
Another question related to this one . I have a List<SortableObjects> that is the
I have read other related question but i cant really get them to relate
I have a question related to database design. The database that I'm working with
I have a question related to C++ design. What are some criteria that you
Not sure whether this is the right place, but I have a question related
This is related to my last question . I have an application that I
I have a question related with JPopupMenu that maybe someone can help me. As
I have a question related with VB.Net Code. I see that the DataTable we
I have question related to what is done in SMS application is if i'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.