2
버튼을 클릭하면 다른 활동에서 계산의 세부 정보를 표시하려고합니다. 어떻게 이것을 달성하십시오. 첫 활동 자바 코드가Android 인 텐트 문제
public void onClick(View v)
{
if(v.getId()==R.id.Button07)
{
Intent intent=new Intent(AdvancedCalculator.this,calculatedData.class);
startActivity(intent);
}
는 내가 원하는 계산은 내가 제출 버튼을 누르면
String a,b;
Integer vis;
a = txtbox3.getText().toString();
b = textview1.getText().toString();
vis = (Integer.parseInt(a)*Integer.parseInt(b))/100;
tv.setText(vis.toString());
난 결과 'TV를'원하는이 다음 활동에 표시하는 것입니다. 하지 OnCreate, 두 번째 활동에서
public void onClick(View v) {
//Put your calculation code here
Bundle b = new Bundle();
b.putString("answer", youranswer);
//You could also use putInteger, whichever you prefer.
Intent intent=new Intent(AdvancedCalculator.this,calculatedData.class);
intent.putExtras(b);
startActivity(intent);
}
: 나는 어떤 도움이 감사
첫 번째 활동에서
첫 번째 활동 수업에서 코드를 수정했지만 앱을 실행할 때마다 앱이 충돌하고 있습니다. 내 활동 클래스는 다음과 같습니다. – abhishek
코드를 게시하지 않았습니다. 그것을 보여주기 위해서는 약간의 혼란이 필요합니다. – NotACleverMan