0
나는 하나의 변수 int를 다음 활동에 대한 문자열을 통해 전달합니다. 다음 활동에서 그 문자열을 가져 와서 다시 int와 int를 반환합니다. 백분율과 디스플레이 및 텍스트 뷰, 과거 변수 및 approx1을 계산하여 비어 있지 않은지 확인한 다음 백분율 ex : ((3/45) * 100)을 계산하고 텍스트 뷰에 표시하여 다시 검토합니다. 문자열 ...하지만 어떤 식 으로든 나는 실수를 할 수 있습니다.퍼센트를 계산하고 texview android studio에 표시합니다.
Bundle bundle = getIntent(). GetExtras();
String aprox1 = bundle.getString ("aprox1");
if (aprox1! = null)
try {
num3 = Integer.parseInt (aprox1);
result = Math.round ((num3/45) * 100);
TextView counter2 = (TextView) findViewById(R.id.textView16);
String abcString2 = Integer.toString (result);
counter2.setText (abcString2);
}
catch (NumberFormatException e) {
}