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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:12:12+00:00 2026-06-09T11:12:12+00:00

I’m new to Android and Java. I want to create an application with one

  • 0

I’m new to Android and Java. I want to create an application with one spinner. I want it to: select an element form the spinner, for example element1, and I want it to show in a text view case, a definite text.

Spinner id: `Spinner_Elemente`
Spinner Items: String Array: `Elemente`
Text View id: edtElemente

Can you help me with some simple code? I looked on the developer site but I don’t understand it. So, I would be grateful if you can help me with an simple code for my example.

sorry for my eng. 🙂

  • 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-09T11:12:14+00:00Added an answer on June 9, 2026 at 11:12 am

    SOLVED, @Rishi,there was a little problem in the code…. The corect code

    public class ChimExpressMainActivity extends Activity implements OnItemSelectedListener {
    Spinner Spinner_Elemente_Java;
    TextView Text_Despre_Element_Afisare;
    
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_chim_express_main);
        Spinner_Elemente_Java=(Spinner) findViewById(R.id.Spinner_Elemente);
        Spinner_Elemente_Java.setOnItemSelectedListener(this);
        Text_Despre_Element_Afisare=(TextView) findViewById(R.id.edtElement);
        Text_Despre_Element_Afisare.setMovementMethod(new ScrollingMovementMethod());
    }
    
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_chim_express_main, menu);
        return true;
    }
    
    public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2,
            long arg3) {
    ////////////////////////----TEST SPINNEER----////////////////////////////////////////////////////////////////////////////////////
            //Text_Despre_Element_Afisare.setText((CharSequence) Spinner_Elemente_Java.getItemAtPosition(arg2));
            //Text_Despre_Element_Afisare.setText("Hidrogenul este elementul chimic în tabelul periodic al elementelor cu simbolul H și numărul atomic 1. Este un gaz ușor inflamabil, incolor, insipid, inodor, iar în natură se întâlnește mai ales sub formă de moleculă diatomică, H2. Având masa atomică egală cu 1,00794 u.a.m. , hidrogenul este cel mai ușor element chimic. Etimologic, cuvântul hidrogen este o combinație a două cuvinte grecești, având semnificația de „a face apă”.Hidrogenul elementar este principala componentă a Universului, având o pondere de 75 % din masa acestuia.[1] În starea de plasmă, se găsește ca element majoritar în alcătuirea stelelor. Hidrogenul elementar este foarte puțin răspândit pe Pământ.Pentru necesități industriale există diferite procedee de fabricație, puse la punct din punct de vedere tehnologic sau aflate în fază de laborator. Hidrogenul poate fi obținut prin electroliza apei, procesul necesitând costuri mai mari decât cel de producere prin procesarea gazelor naturale.[2]Cel mai răspândit izotop al hidrogenului este protiul, care este alcătuit dintr-un singur proton în nucleu și un electron în învelișul electronic. În compușii ionici poate avea sarcină negativă (anion cunoscut sub numele de hidrură, H-) sau sarcină pozitivă H+ (cation). Hidrogenul formează compuși chimici cu majoritatea elementelor din sistemul periodic și este prezent în apă și în mulți dintre compușii organici. Are un rol important în reacțiile acido-bazice, acestea bazându-se pe schimbul de protoni între molecule. Fiind singurul atom pentru care soluția analitică a ecuației lui Schrödinger este pe deplin cunoscută, prezintă un rol major în fundamentarea teoriei mecanicii cuantice.Hidrogenul este un gaz puternic reactiv și își găsește aplicații datorită capacității sale chimice de reducător.[3] Hidrogenul se folosește în industria petrochimică la producerea benzinelor, în industria chimico-alimentară pentru hidrogenarea grăsimilor (de exemplu producerea margarinei), în prelucrările mecanice ale metalelor și în tratamentul termic al acestora.[4]Hidrogenul reprezintă o alternativă pentru înlocuirea benzinei drept combustibil pentru vehiculele echipate cu motoare cu ardere internă.[5] Avantajele sale principale constau în faptul că este ecologic, din arderea sa rezultând vapori de apă, iar randamentul termic al motoarelor cu hidrogen este ridicat. Dezavantajele constau în pericolul mare de explozie, dificultatea stocării în vehicul și lipsa unor rețele de stații de alimentare cu hidrogen. Una dintre cele mai promițătoare soluții tehnice o reprezintă conversia directă a energiei chimice din hidrogen în electricitate, prin intermediul pilelor de combustie.[6]");
            //Text_Despre_Element_Afisare.setText(Html.fromHtml("<h2>Title</h2><br><p>Description here</p>"));
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////    
    
        if(arg0.getSelectedItem().toString().equals("Hidrogen")){
            Text_Despre_Element_Afisare.setText((CharSequence) Spinner_Elemente_Java.getItemAtPosition(arg2));
        }
        else{
            if(arg0.getSelectedItem().toString().equals("Heliu"))
            {
                Text_Despre_Element_Afisare.setText((CharSequence) Spinner_Elemente_Java.getItemAtPosition(arg2));
            }
            else{
                Text_Despre_Element_Afisare.setText("Close");
            }
        }
    }
    
    public void onNothingSelected(AdapterView<?> arg0) {
        // TODO Auto-generated method stub
    
    }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want use html5's new tag to play a wav file (currently only supported
I'm trying to select an H1 element which is the second-child in its group
I want to show the soap response to UIWebview.. my soap response is, <p><img
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into

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.