Android Launch!
[2012-03-13 16:42:29 - Activity_03] adb is running normally.
[2012-03-13 16:42:29 - Activity_03] Performing mars.Activity03.Activity03 activity launch
[2012-03-13 16:42:29 - Activity_03] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'android1.6'
[2012-03-13 16:42:34 - Activity_03] Application already deployed. No need to reinstall.
[2012-03-13 16:42:34 - Activity_03] Starting activity mars.Activity03.Activity03 on device emulator-5554
[2012-03-13 16:42:38 - Activity_03] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=mars.Activity03/.Activity03 }
error:
E/AndroidRuntime(805): Uncaught handler: thread main exiting due to uncaught exception
(这个哪里会有异常??)
03-13 08:50:03.854: E/AndroidRuntime(805): java.lang.RuntimeException: Unable to start activity ComponentInfo{mars.Activity03/mars.Activity03.ResultActivity}: java.lang.NumberFormatException: unable to parse 'null' as integer(我在两个框里输入的都是整数,怎么不能转了?)
Activity03.java内容如下:
Java code
package mars.Activity03;
import android.app.Activity;import android.content.Intent;import android.os.Bundle;
import android.view.View;import android.view.View.OnClickListener;
import android.widget.*;
public class Activity03 extends Activity {
private EditText factorOne,factorTwo;
private TextView symbol;
private Button calculate;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//根据控件的ID来取得代表控件的对象
factorOne=(EditText)findViewById(R.id.factorOne);
factorTwo=(EditText)findViewById(R.id.factorTwo);
symbol=(TextView)findViewById(R.id.symbol);
calculate=(Button)findViewById(R.id.calculate);
// symbol.setText("乘以");
//calculate.setText("计算");
symbol.setText(R.string.symbol);
calculate.setText(R.string.calculate);
calculate.setOnClickListener(new CalculateListener());
}
class CalculateListener implements OnClickListener{
public void onClick(View arg0) {