我无法弄清楚它在这里发生了什么......下班后......
这是有问题的活动(为了缩小问题,我已经非常轻松了):
public class UserAuthenticationActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
Log.e("MYAPP", "step1");
super.onCreate(savedInstanceState);
setContentView(R.layout.user_authentication);
Log.e("MYAPP", "step2");
}
@Override
public void onStart()
{
super.onStart();
}
}
这是layout / user_authentication:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scrollbars="vertical"
android:padding="15sp"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="hello!"
android:paddingTop="15sp"
android:paddingBottom="5sp"
android:textSize="15sp"
/>
</LinearLayout>
</ScrollView>
启动应用程序时出现错误屏幕。日志不显示我的调试消息,只是这个例外:
I/ActivityManager( 1032): Starting activity: Intent { comp={com.myapp.android.app/com.myapp.android.app.activity.UserAuthenticationActivity} }
D/Database( 1990): hook db is called for:/data/data/com.myapp.android.app/databases/myappDatabase.db
D/Database( 1990): hook not enabled for /data/data/com.myapp.android.app/databases/myappDatabase.db
E/QC-DSS-LIB( 981): unrecognized ifindex 6
W/dalvikvm( 1990): threadid=3: thread exiting with uncaught exception (group=0x4000fe70)
E/AndroidRuntime( 1990): Uncaught handler: thread main exiting due to uncaught exception
E/AndroidRuntime( 1990): java.lang.NullPointerException
E/AndroidRuntime( 1990): at android.widget.ListView.measureScrapChild(ListView.java:1039)
E/AndroidRuntime( 1990): at android.widget.ListView.measureHeightOfChildren(ListView.java:1120)
E/AndroidRuntime( 1990): at android.widget.ListView.onMeasure(ListView.java:1031)
E/AndroidRuntime( 1990): at android.view.View.measure(View.java:7236)
E/AndroidRuntime( 1990): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2875)
E/AndroidRuntime( 1990): at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:888)
E/AndroidRuntime( 1990): at android.widget.LinearLayout.measureVertical(LinearLayout.java:350)
E/AndroidRuntime( 1990): at android.widget.LinearLayout.onMeasure(LinearLayout.java:278)
E/AndroidRuntime( 1990): at android.view.View.measure(View.java:7236)
E/AndroidRuntime( 1990): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2875)
E/AndroidRuntime( 1990): at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
E/AndroidRuntime( 1990): at android.view.View.measure(View.java:7236)
E/AndroidRuntime( 1990): at android.widget.LinearLayout.measureVertical(LinearLayout.java:464)
E/AndroidRuntime( 1990): at android.widget.LinearLayout.onMeasure(LinearLayout.java:278)
E/AndroidRuntime( 1990): at android.view.View.measure(View.java:7236)
E/AndroidRuntime( 1990): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:2875)
E/AndroidRuntime( 1990): at android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
E/AndroidRuntime( 1990): at android.view.View.measure(View.java:7236)
E/AndroidRuntime( 1990): at android.view.ViewRoot.performTraversals(ViewRoot.java:698)
E/AndroidRuntime( 1990): at android.view.ViewRoot.handleMessage(ViewRoot.java:1482)
E/AndroidRuntime( 1990): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 1990): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 1990): at android.app.ActivityThread.main(ActivityThread.java:3948)
E/AndroidRuntime( 1990): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 1990): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 1990): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
E/AndroidRuntime( 1990): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
E/AndroidRuntime( 1990): at dalvik.system.NativeStart.main(Native Method)
我希望有人可以帮助我。我没有任何线索。
谢谢,
丹
答案 0 :(得分:3)
可能是因为没有内容视图吗?
其他兴趣点: