When emulating, it knocks out a program, although the development environment does not give an error.

@Override public void onCheckedChanged(RadioGroup group, int checkedId) { int parse_kolichestvo = Integer.parseInt(tvResult.getText().toString()); switch (checkedId) { case R.id.radioButton_250: cena.setText(getString(**R.string.cena53*parse_kolichestvo**)); break; case R.id.radioButton_500: cena.setText(getString(**R.string.cena73*parse_kolichestvo**)); break; } } }); 

The problem is precisely in the part of multiplication and reference to the string.

    1 answer 1

    You are trying to do something strange in your code ... Namely, to multiply the ID of a string resource, something generated by the system with each build of the project and serves only to find a string with a number. Apparently you need:

    1. Get a string by its ID
    2. Convert string to number
    3. Multiply numbers
    4. Convert the resulting number to string

       cena.setText(String.valueof(Integer.parseInt(getString(R.string.cena73))*parse_kolichestvo)));` 
    • getString(R.string.cena73))*parse_kolichestvo) string is multiplied by int - santavital
    • and why keep the price in a row ... - pavel
    • @pavel, this is a great secret) - YuriySPb
    • Boys, thank you) - Romik romikromik