2 smallearth Smallearth 于 2013.02.21 14:11 提问

application xxx stopped unexpectedly
strings.xml  
[html] view plaincopy
<?xml version="1.0" encoding="utf-8"?>  
<resources>  
    <string name="app_name">msm</string>  
    <string name="action_settings">Settings</string>  
    <string name="number">电话号码</string>  
    <string name="content">短信内容</string>  
    <string name="button">发送</string>  

</resources>  
[html] view plaincopy
activity_main.xml  
[html] view plaincopy
<?xml version="1.0" encoding="utf-8"?>  
<LinearLayout    
   xmlns:android="http://schemas.android.com/apk/res/android"    
    android:orientation="vertical"    
    android:layout_width="fill_parent"    
    android:layout_height="fill_parent">    

    <TextView  
        android:id="@+id/textView1"  
        android:layout_width="fill_parent"  
        android:layout_height="wrap_content"  
        android:text="@string/number" />  

    <EditView  
        android:id="@+id/number"  
        android:layout_width="fill_parent"  
        android:layout_height="wrap_content" />  

    <TextView  
        android:layout_width="fill_parent"  
        android:layout_height="wrap_content"  
        android:text="@string/content" />  

    <EditView  
        android:id="@+id/content"  
        android:layout_width="fill_parent"  
        android:layout_height="wrap_content"  
        android:minLines="3" />  

    <Button  
        android:id="@+id/button"  
        android:layout_width="wrap_content"  
        android:layout_height="wrap_content"  
        android:text="@string/button" />  

</LinearLayout>   
[java] view plaincopy
MainActivity.java  
[java] view plaincopy
package com.example.msm;  

import android.os.Bundle;  
import android.app.Activity;  
import android.view.Menu;  

public class MainActivity extends Activity {  

    @Override  
    protected void onCreate(Bundle savedInstanceState) {  
        super.onCreate(savedInstanceState);  
        setContentView(R.layout.activity_main);  
    }  

    @Override  
    public boolean onCreateOptionsMenu(Menu menu) {  
        // Inflate the menu; this adds items to the action bar if it is present.  
        getMenuInflater().inflate(R.menu.main, menu);  
        return true;  
    }  

}  
Csdn user default icon
上传中...
上传图片
插入图片