这些代码我看了很久 不知道哪里出错了。
  Activity_03.java
 public class Activity_03 extends Activity {
    /** Called when the activity is first created. */
private EditText FactorOne=null;
private EditText FactorTwo=null;
private TextView MyTextView=null;
private Button MyButton=null;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        FactorOne=(EditText)findViewById(R.id.FactorOne);
        FactorTwo=(EditText)findViewById(R.id.FactorTwo);
        MyTextView=(TextView)findViewById(R.id.MyTextView);
        MyButton =(Button)findViewById(R.id.MyButton);
        MyTextView.setText(R.string.symbol);
        MyButton.setText(R.string.calculator);
        MyButton.setOnClickListener(new CalculatorListener());
        
    }
    class CalculatorListener  implements OnClickListener{ @Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
Intent intent=new Intent();
String FactorOneStr=FactorOne.getText().toString();
String FactorTwoStr=FactorTwo.getText().toString();
intent.putExtra("one", FactorOneStr);
intent.putExtra("Two", FactorTwoStr);
intent.setClass(Activity_03.this, ResultActivity.class);
Activity_03.this.startActivity(intent);


}
    
    
    } 
}

ResultActivity.java

  package tian.Activity03;import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;public class ResultActivity extends Activity {
    private TextView resultView=null;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.result);
resultView=(TextView)findViewById(R.id.resultView);
Intent intent =getIntent();
String FactorOneStr=intent.getStringExtra("one");
String FactorTwoStr=intent.getStringExtra("two");
int factorOneInt=Integer.parseInt(FactorOneStr);
int factorTwoInt=Integer.parseInt(FactorTwoStr);
int Result=factorOneInt*factorTwoInt;
resultView.setText(Result+"");
}}
 注册里面:
    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".Activity_03"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
  <activity android:name=".ResultActivity"></activity>

解决方案 »

  1.   


    就是Application has not expected 常见的错误吧?
      

  2.   


    就是Application has not expected    这是常见的错误吧?
      

  3.   

    用log cat跟踪一下吧  我也是新手, 一般我都这么搞的  看看log cat里面报的什么错误也行
      

  4.   

    引用:
    intent.putExtra("Two", FactorTwoStr);
    String FactorTwoStr=intent.getStringExtra("two");你的两个key不对应啊 ,要都写成"two" ,java是大小写敏感的,否则你取不到值哦