Android 不幸的是,应用程序已在.davik.system.NativeStart.main(NativeMethod)停止工作

Android 不幸的是,应用程序已在.davik.system.NativeStart.main(NativeMethod)停止工作,android,Android,我是android开发新手,所以无法修复这段代码。谢谢你的帮助 ` 我的xml文件是 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" andr

我是android开发新手,所以无法修复这段代码。谢谢你的帮助 `

我的xml文件是

 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
 xmlns:tools="http://schemas.android.com/tools"
 android:layout_width="match_parent"
 android:layout_height="match_parent"
 android:paddingBottom="@dimen/activity_vertical_margin"
 android:paddingLeft="@dimen/activity_horizontal_margin"
 android:paddingRight="@dimen/activity_horizontal_margin"
 android:paddingTop="@dimen/activity_vertical_margin"
 tools:context="com.example.jumbo.MainActivity$PlaceholderFragment" >
<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/hello_world" />


<ImageView
    android:id="@+id/login"
    android:layout_width="200dp"
    android:layout_height="200dp"
    android:src="@+drawable/com_facebook_button_blue"
    />

<ImageView
    android:id="@+id/profile_pic"
    android:layout_width="200dp"
    android:layout_height="200dp"
    android:layout_alignBottom="@+id/login"
    android:layout_alignRight="@+id/login"
    android:visibility="invisible" />

</RelativeLayout>
日志文件

07-01 00:48:36.373:E/AndroidRuntime19356:致命异常:主 07-01 00:48:36.373:E/AndroidRuntime19356:Process:com.example.jumbo,PID:19356 07-01 00:48:36.373:E/AndroidRuntime19356:android.os.NetworkOnMainThreadException 07-01 00:48:36.373:E/AndroidRuntime19356:at android.os.StrictMode$AndroidBlockGuardPolicy.onNetworkStrictMode.java:1145 07-01 00:48:36.373:E/AndroidRuntime19356:at java.net.InetAddress.lookupHostByNameInetAddress.java:385 07-01 00:48:36.373:E/AndroidRuntime19356:at java.net.InetAddress.GetAllByNameImplineAddress.java:236 07-01 00:48:36.373:E/AndroidRuntime19356:at java.net.InetAddress.getAllByNameInetAddress.java:214 07-01 00:48:36.373:E/AndroidRuntime19356:com.android.okhttp.internal.Dns$1.getAllByNameDns.java:28 07-01 00:48:36.373:E/AndroidRuntime19356:com.android.okhttp.internal.http.RouteSelector.resetNextInetSocketAddressRouteSelector.java:216 07-01 00:48:36.373:E/AndroidRuntime19356:com.android.okhttp.internal.http.RouteSelector.nextRouteSelector.java:122 07-01 00:48:36.373:E/AndroidRuntime19356:com.android.okhttp.internal.http.HttpEngine.connectHttpEngine.java:292 07-01 00:48:36.373:E/AndroidRuntime19356:com.android.okhttp.internal.http.HttpEngine.sendSocketRequestHttpEngine.java:255 07-01 00:48:36.373:E/AndroidRuntime19356:com.android.okhttp.internal.http.HttpEngine.sendRequestHttpEngine.java:206 07-01 00:48:36.373:E/AndroidRuntime19356:com.android.okhttp.internal.http.HttpURLConnectionImpl.executeHttpURLConnectionImpl.java:345 07-01 00:48:36.373:E/AndroidRuntime19356:com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponseHttpURLConnectionImpl.java:296 07-01 00:48:36.373:E/AndroidRuntime19356:com.android.okhttp.internal.http.HttpURLConnectionImpl.getInputStreamHttpURLConnectionImpl.java:179 07-01 00:48:36.373:E/AndroidRuntime19356:com.android.okhttp.internal.http.HttpsURLConnectionImpl.getInputStreamHttpsURLConnectionImpl.java:246 07-01 00:48:36.373:E/AndroidRuntime19356:com.facebook.android.Util.openUrlUtil.java:224 07-01 00:48:36.373:E/AndroidRuntime19356:com.facebook.android.facebook.requestImplFacebook.java:804 07-01 00:48:36.373:E/AndroidRuntime19356:com.facebook.android.facebook.requestFacebook.java:707 07-01 00:48:36.373:E/AndroidRuntime19356:com.facebook.android.facebook.logoutImplFacebook.java:649 07-01 00:48:36.373:E/AndroidRuntime19356:com.facebook.android.facebook.logoutFacebook.java:642 07-01 00:48:36.373:E/AndroidRuntime19356:at com.example.jumbo.MainActivity.onClickMainActivity.java:75 07-01 00:48:36.373:E/AndroidRuntime19356:at-android.view.view.performClickView.java:4438 07-01 00:48:36.373:E/AndroidRuntime19356:at-android.view.view$PerformClick.runView.java:18422 07-01 00:48:36.373:E/AndroidRuntime19356:at-android.os.Handler.handleCallbackHandler.java:733 07-01 00:48:36.373:E/AndroidRuntime19356:at android.os.Handler.dispatchMessageHandler.java:95 07-01 00:48:36.373:E/AndroidRuntime19356:at-android.os.Looper.Looper.java:136 07-01 00:48:36.373:E/AndroidRuntime19356:at android.app.ActivityThread.mainActivityThread.java:5001 07-01 00:48:36.373:E/AndroidRuntime19356:at java.lang.reflect.Method.Invokenactive方法 07-01 00:48:36.373:E/AndroidRuntime19356:at java.lang.reflect.Method.invokeMethod.java:515 07-01 00:48:36.373:E/AndroidRuntime19356:com.android.internal.os.ZygoteInit$methodAndArgscaler.runZygoteInit.java:785 07-01 00:48:36.373:E/AndroidRuntime19356:com.android.internal.os.ZygoteInit.mainZygoteInit.java:601 07-01 00:48:36.373:E/AndroidRuntime19356:at dalvik.system.NativeStart.main本地方法 07-01 00:48:39.113:I/Process19356:发送信号。PID:19356 SIG:9

我的xml文件的名称是activity_main.xml

每次我点击其中一个按钮,应用程序就会在我的设备上崩溃,我已经检查了xml文件,但似乎无法找出问题所在

它显示logcat at.davik.system.NativeStart.mainNativeMethod中的错误
谢谢:

您正在通过UI主线程访问网络。不要在主线程上执行此类操作,因为它们可能会由于延迟等原因导致应用程序没有响应。请尝试http://developer.android.com/reference/android/os/AsyncTask.html

发布完整的日志猫输出xml的名称是什么?我刚刚上传了日志猫文件,xml文件的名称是activity_main.xml。非常感谢你们,伙计们
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
 xmlns:tools="http://schemas.android.com/tools"
 android:layout_width="match_parent"
 android:layout_height="match_parent"
 android:paddingBottom="@dimen/activity_vertical_margin"
 android:paddingLeft="@dimen/activity_horizontal_margin"
 android:paddingRight="@dimen/activity_horizontal_margin"
 android:paddingTop="@dimen/activity_vertical_margin"
 tools:context="com.example.jumbo.MainActivity$PlaceholderFragment" >
<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/hello_world" />


<ImageView
    android:id="@+id/login"
    android:layout_width="200dp"
    android:layout_height="200dp"
    android:src="@+drawable/com_facebook_button_blue"
    />

<ImageView
    android:id="@+id/profile_pic"
    android:layout_width="200dp"
    android:layout_height="200dp"
    android:layout_alignBottom="@+id/login"
    android:layout_alignRight="@+id/login"
    android:visibility="invisible" />

</RelativeLayout>