android - Operation of Subtraction and write the result in the shared preferences -


I have priority with the value of 20 in string (A), I have to subtract the value of an int (b) 0 From 20, I tried to do this

  string A = prefs .getString (A, "20"); Int B = intent.getIntExtra (trn + ".INB", 0); TextView TVRest = (TextView) Find ViewById (R.id.txtrest); TvRest.setText (A - (B));  

I need to display AB results in TextView txtrest , as I have done.

After you get results, instead of the initial value of C, you can write C in the preferences in C.

Do something like below,

  int A = integer Parasont (prefs.getString (A, "20")); Int B = intent.getIntExtra (trn + ".INB", 0); Int C = A-B; TextView TVRest = (TextView) Find ViewById (R.id.txtrest); TvRest.setText (String.valueOf (C));  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

lua - HowTo create a fuel bar -