java.lang.RuntimeException: Unable to start activity ComponentInfo

android activity打不开,具体错误如下:

10-23 10:00:05.739 9655-9655/com.example.fragmentbestpractice E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.fragmentbestpractice, PID: 9655
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.fragmentbestpractice/com.example.fragmentbestpractice.NewsContentActivity}: java.lang.NullPointerException: Attempt to invoke virtual method ‘void android.view.View.setVisibility(int)’ on a null object reference

定位acitivity

setContentView(R.layout.activity_main);

定位activity_main.xml

<view
        android:layout_width="1dp"
        android:layout_height="match_parent"
        android:layout_alignParentLeft="true"
        android:background="#000" />

这里的“view”的“v”应该大写“V”,才是Android库中的View。

你可能感兴趣的:(安卓开发)