-7

I want to calculate the circumference of a circle and put the results in a TextView.

   public void hesapla1(View v){

        double pi = 3.14;
        double yari = R.id.e1;

        double alan = pi * Math.pow(yari,2);

        sonuc1.setText((int) alan);

    }
Niels Masdorp
  • 2,534
  • 2
  • 18
  • 31

1 Answers1

2

You can only set a String value in a TextView:

sonuc1.setText(String.valueOf(alan));

rastadrian
  • 1,025
  • 1
  • 10
  • 17
Brijesh Chopda
  • 195
  • 2
  • 11