arrays - Android - Spinners -


I have a question and know that it has been called one million times, I am quite new to Android programming. So I'm kinda boggled

I've created two parallel arrays -. The phrase containing spinner in two languages. As it changes in value (from array 1) - TextView translation should be updated with sentence (in the second array)

Two arrays string.xml, below to the same And the spinner gets value from there.

  & Lt ;. String array name = "Array_Name" & gt; & Lt; Items & gt; Phrase1 & lt; / Item & gt; & Lt; Items & gt; Phrase2 & lt; / Item & gt; & Lt; Items & gt; Phrase3 & lt; / Item & gt; & Lt; Items & gt; Phrase4 & lt; / Item & gt; & Lt; / String array & gt;   

I'm not sure how to go about doing this or if it's a viable way of doing this ... but I'm doubling ....

Anyone help please?

You should install OnItemSelectedListener change spinner text

  spinner.setOnItemSelectedListener (new AdapterView.OnItemSelectedListener () {@Override public void onItemSelected (AdapterView & LT ;? & gt ;. parents, to see see, int position, long id) {textView.setText (getResources () getTextArray (R.array .array_name) [position]);} @ Othrraid public void some were not selected (Adaptrwu & lt ;? & Gt; parent) {}});    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -