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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:40:57+00:00 2026-06-05T16:40:57+00:00

I am opening spiiner with onclick on button but my spinner is not trigger

  • 0

I am opening spiiner with onclick on button but my spinner is not
trigger setOnItemSelectedListener this portion of code is not working public void onItemSelected(AdapterView arg0, View arg1,
int pos,
long id) {
language = AppConstants.Language_arr[pos];

                    }
                    public void onNothingSelected(AdapterView<?> arg0) {
                        // TODO Auto-generated method stub

                    } spinner opens but onitemselected is not working
import com.privy.constants.AppConstants;
            import android.app.Activity;
            import android.os.Bundle;
            import android.view.View;
            import android.view.View.OnClickListener;
            import android.widget.AdapterView;
            import android.widget.AdapterView.OnItemSelectedListener;
            import android.widget.ArrayAdapter;
            import android.widget.Button;
            import android.widget.Spinner;
            import android.widget.ToggleButton;

            public class Settings extends Activity implements OnClickListener {
                private Spinner sp_languge, sp_login;
                private ToggleButton toggle_news_letter;
                private String language;
                private Button language_change;
                @Override
                protected void onCreate(Bundle savedInstanceState) {
                    // TODO Auto-generated method stub
                    super.onCreate(savedInstanceState);
                    setContentView(R.layout.settings);
                    sp_languge = new Spinner(this);
                    ArrayAdapter<String> adapter_language = new ArrayAdapter<String>(
                            Settings.this, R.layout.spinner_item, AppConstants.Language_arr);
                    sp_languge.setAdapter(adapter_language);
                    language_change = (Button) findViewById(R.id.language_change);
                    language_change.setOnClickListener(this);
                    sp_languge.setOnItemSelectedListener(new OnItemSelectedListener() {

                        public void onItemSelected(AdapterView<?> arg0, View arg1, int pos,
                                long id) {
                            language = AppConstants.Language_arr[pos];

                        }
                        public void onNothingSelected(AdapterView<?> arg0) {
                            // TODO Auto-generated method stub

                        }
                    });
                }
                public void onClick(View v) {
                    if (v == language_change) {

                        sp_languge.performClick();

                    }
                }
            }
  • 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-05T16:40:59+00:00Added an answer on June 5, 2026 at 4:40 pm

    add the spiiner on XMl with width/height zero……………….

    and use

    sp_languge = (Spinner)findViewById(R.id.<my_spinerid>);
    

    android spinner performClick onItemSelected

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

Sidebar

Related Questions

Why is this not opening in a new window? <a href=http://www.authorsden.com/visit/viewwork.asp?id=49784&AuthorID=157940> <img src=authors_den.jpg target=blank
Response To: Opening Popup Window is not working in firefox and google chrome Hi,I
Im opening a map like this: NSString *urlString = [NSString stringWithFormat:@http://maps.google.com/maps?q=%@,%@, destLat, destLong]; [[UIApplication
i am opening jQuery Dialog through the below code.The problem here is when i
Opening a public page from browser works fine. Downloading same page using WebClient throws
Javascript run at page opening or later by user action like clicking a button
I am opening a minecraft class folder with notepad++. But whenever I open it,
I am opening a dialog box with a button click event. Dialog box contains
Opening up the Postgres codebase, I see that much of the C code is
I'm opening a solution that was apparently built on Visual Studio 2003 (not sure,

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.