There is such a construction

int parse_txtw = Integer.parseInt(getString(R.string.value)); view.setText(String.valueOf(Integer.parseInt(spinervalue)*parse_txtw)); 

Then, when I try to call a value from another class using view.getText().toString() , the original, not the actual value from the R.string is called, but a new one is needed, depending on the set value in the spiner and its multiplication.

I will reformulate the question and describe it in another way. there is a textview, I assign it a value in the markup android:text="0" by default, before the arithmetic operations, then the code picks up the default string resource <string name="textview222">77</string> , does the operation, and let's say in the amount comes out 100 and is set to the same textview, and instead of 0, it is assigned 100, which is logical and works as it should, but until I want to pull these 100 out of another class using getText (). toString (), instead of 100, 0 is pulled out, original meaning.

Here is a piece where there is an appeal

  ArrayList<HashMap<String, String>> myArrList = new ArrayList<HashMap<String, String>>(); HashMap<String, String> map; map = new HashMap<String, String>(); map.put("key", txtwiew.getText().toString()); myArrList.add(map); 
  • 2
    Values ​​in class R are written at compile time and cannot be changed at runtime. Try to reformulate the question - at the moment you are describing an impossible situation and that is very vague - Yuriy SPb
  • @YuriySPb Described in more detail in the body of the letter. I hope you understand me) - Romik romikromik
  • Apparently you are creating a new copy of the text field instead of referring to the existing one. Show how you get a link to the text field to select its value - YuriySPb
  • @YuriySPb updated - Romik romikromik
  • one
    You need to get the value into a variable inside the first class and then explicitly pass it to another class. If the activation is not visible on the screen, its widgets no longer exist and the values ​​in them will be lost. - pavlofff

0