Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String calorie = getIntent().getStringExtra("calorie");
- TextView textView1 = (TextView)findViewById(R.id.textView1);
- String strOldValue = textView1.getText().toString();
- Integer oldValue;
- try{
- oldValue= Integer.parseInt(myString);
- }catch(NumberFormatException e){
- oldValue =0;
- }
- Integer newValue;
- try{
- newValue= Integer.parseInt(calorie);
- }catch(NumberFormatException e){
- newValue =0;
- }
- textView1.setText((oldValue + newValue));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement