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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:46:03+00:00 2026-06-01T07:46:03+00:00

I am developing an quiz based app and i wanted to know how i

  • 0

I am developing an quiz based app and i wanted to know how i can do it.I want the text view and layout to remain stagnant only the questions and its options should change when next button is pressed.can some one help me out with this. Thank You in advance. Any help is appreciable

  • 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-01T07:46:04+00:00Added an answer on June 1, 2026 at 7:46 am

    Assuming that you have the layout in place for your quiz:

    In your activity you can do something like:

    Button nextButton=(Button) findViewById(R.id.nextbutton);
            nextButton.setOnClickListener(new OnClickListener() {
    
                @Override
                public void onClick(View v) {
                    question.setText(questions.get(questionNumber));
    answersList = new AnswersListAdapter(
                    getBaseContext(), splitAnswers[questionNumber], -1 , false);
    answers.setAdapter(answersList);
    
                }
            });
    

    AnswersListAdapter.java

    import android.content.Context;
    import android.view.LayoutInflater;
    import android.view.View;
    import android.view.ViewGroup;
    import android.widget.BaseAdapter;
    import android.widget.ImageView;
    import android.widget.RelativeLayout;
    import android.widget.TextView;
    
    public class AnswersListAdapter extends BaseAdapter {
    
        private Context context;
        private String [] splitAnswers;
        public AnswersListAdapter(Context context,String [] splitAnswers){
            super();
            this.context=context;
            this.splitAnswers=splitAnswers;
        }
    
        @Override
        public int getCount() {
            return splitAnswers.length;
        }
    
        @Override
        public Object getItem(int arg0) {
            return splitAnswers[arg0];
        }
    
        @Override
        public long getItemId(int arg0) {
            return splitAnswers[arg0].hashCode();
        }
    
        @Override
        public View getView(int position, View arg1, ViewGroup arg2) {
            LayoutInflater inflater = LayoutInflater.from(context);
            RelativeLayout root = (RelativeLayout) inflater.inflate(R.layout.answers_item, null,false);
    
            TextView label =(TextView) root.findViewById(R.id.label);
            ImageView options=(ImageView) root.findViewById(R.id.options);
    
    
                    label.setText(splitAnswers[position]);
            return root;
        }
    
    }
    

    answers_item.xml

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="2dp" >
        <TextView
            android:id="@+id/label"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:paddingBottom="3dp"
            android:paddingLeft="50dp"
            android:paddingTop="3dp"
            android:text="@+id/label"
            android:textColor="#FFFFFF" >
        </TextView>
        <ImageView
            android:id="@+id/options"
            android:layout_width="30dp"
            android:layout_height="30dp"
            android:layout_alignLeft="@id/label"
            android:layout_alignTop="@id/label"
            android:background="@drawable/a" >
        </ImageView>
    </RelativeLayout>
    

    You might have to do some customization depening on where exactly your data is coming in from and also few other factors. Hope it helps.

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

Sidebar

Related Questions

I am developing an quiz based application. I wanted to know like, how can
I am developing a quiz based app. The quiz contains 1 question and 4
I am developing an quiz based app in that when the user clicks any
I am developing a simple quiz app on Android. The questions in the quiz
I'm developing an Android app which is a quiz. On the other hand, I'm
I am developing HTML5 css3 & js based game. So i want everything should
I am developing Quiz project. In DetailsView I want to display the Question and
I am developing a quiz application using LWUIT where users can choose from different
Developing mobile apps is a challenging job. Customers want to be present not only
I'm developing an app, which be be a game/quiz type application for testing a

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.