读书人

照着书里的代码打了一遍不过运作总是

发布时间: 2013-09-05 16:02:07 作者: rapoo

照着书里的代码打了一遍,不过运行总是崩溃

MainActivity.java的代码


android:layout_height="wrap_content"
android:text="@string/kkk" />

<Button android:id="@+id/ok"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/trans"/>
</LinearLayout>



result.xml的布局
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<TextView
android:id="@+id/getdata"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>

</LinearLayout>


AndroidManifest.xml的部分配置
 <application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".ResultActivity"></activity>
</application>



运行总提示:The application activity(process com.example.activity) has stopped unexpectedly.please try again.不清楚哪里出了问题,帮忙看下,谢谢谢谢

分享到:
[解决办法]
仔细看看LogCat下面的日志,定位出错的地方。

读书人网 >Android

热点推荐