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 9240295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:09:51+00:00 2026-06-18T08:09:51+00:00

Im facing a problem in quiz app… My problem is.. I got the Questionid,

  • 0

Im facing a problem in quiz app…

My problem is..

I got the Questionid, questions and answers through JSON. And i stored in hashmap with single key. Now What i want to do is…

How can i get the question and answers from hashmap based upon questionid..to display the question in textview and answers in radiobuttons…

How can i implement this? Any help would be appreciated…Thanks a lot in advance..

  protected void onPostExecute(String file_url) {
   pDialog.dismiss();   
       List<NameValuePair> params = new ArrayList<NameValuePair>();
    params.add(new BasicNameValuePair("tid", tid));
    JSONObject json = jsonParser.makeHttpRequest(url_get_quesid, "GET", params);
    json = jsonParser.makeHttpRequest(url_get_quesurl, "GET", params);
      try {
    int success = json.getInt(TAG_SUCCESS);
    if (success == 1) {
    System.out.println("Success");
    groups = json.getJSONArray(TAG_GROUP);
    System.out.println("Result Success+++"+groups);
    for (int i = 0; i < groups.length();i++) {
    JSONObject c = groups.getJSONObject(i);
    String questionid = c.getString(TAG_QUESID);
    String question = c.getString(TAG_QUES);
    String answer = c.getString(TAG_ANSW);
    System.out.println("Checking ::"+questionid);
    id=questionid;         
    quesid.add(questionid);
    HashMap<String, String> map = new HashMap<String, String>();
    map.put(questionid,  question + ";" + answer);                  
    System.out.println("QuestionIDMap:"+map);
        }
    } else {
    showAlert();
}
    } catch (JSONException e) {
    System.out.println("Error "+e.toString());
    }       
}
  • 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-06-18T08:09:52+00:00Added an answer on June 18, 2026 at 8:09 am

    First of all you want to use your questionid as the map key.

    Once you’ve got that ,you can simply do something simular to;

    String total = map.get(questionid);
    String[] split = total.split(“;”);

    String question = split[0];
    String answer = split[1];


    In total i’d rather recommend using a database though, then saving everything in collections.

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

Sidebar

Related Questions

I am facing problem that. when I insert single quote in text field. on
I'm facing problem when migrate my web app project from development server to live
I have facing problem to access xmlrpc. Whenever I tried to access xmlrpc through
I am facing problem on binding jquery event on items created through another action
I am facing problem when I am posting a JSON data to the server
I am facing problem. I need to build one app in two ways, first
I m facing problem in sorting this 2-d array on the basis of key
I am facing problem when i run my app on Device connected to my
Iam facing problem in understanding and converting a matlab code into opencv. I want
iam facing problem in passing array to view. this is my controller code.. function

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.