0

I am trying to run the WiFi Direct Demo example from the Google API 14 and when I try to share any file from one phone to another via the demo app, I am only able to share photos(jpg) files...anything else, the app force closes. I am using a Motorola RAZR HD and a Samsung Galaxy S3 for testing. Any assistance please? Thanks!

The following error appears in LogCat:

04-28 21:25:19.632: E/AndroidRuntime(23515): FATAL EXCEPTION: main
04-28 21:25:19.632: E/AndroidRuntime(23515): untimeException: Failure delivering result ResultInfo{who=android:fragment:1, request=20, result=0, data=null}java.lang.R to activity {com.classroom_app/com.classroom_app.WiFiDirectActivity}: java.lang.NullPointerException
04-28 21:25:19.632: E/AndroidRuntime(23515):    at android.app.ActivityThread.deliverResults(ActivityThread.java:3304)
04-28 21:25:19.632: E/AndroidRuntime(23515):    at android.app.ActivityThread.handleSendResult(ActivityThread.java:3347)
04-28 21:25:19.632: E/AndroidRuntime(23515):    at android.app.ActivityThread.access$1100(ActivityThread.java:139)
04-28 21:25:19.632: E/AndroidRuntime(23515):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1296)
04-28 21:25:19.632: E/AndroidRuntime(23515):    at android.os.Handler.dispatchMessage(Handler.java:99)
04-28 21:25:19.632: E/AndroidRuntime(23515):    at android.os.Looper.loop(Looper.java:137)
04-28 21:25:19.632: E/AndroidRuntime(23515):    at android.app.ActivityThread.main(ActivityThread.java:5070)
04-28 21:25:19.632: E/AndroidRuntime(23515):    at java.lang.reflect.Method.invokeNative(Native Method)
04-28 21:25:19.632: E/AndroidRuntime(23515):    at java.lang.reflect.Method.invoke(Method.java:511)
04-28 21:25:19.632: E/AndroidRuntime(23515):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
04-28 21:25:19.632: E/AndroidRuntime(23515):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:558)
04-28 21:25:19.632: E/AndroidRuntime(23515):    at dalvik.system.NativeStart.main(Native Method)
04-28 21:25:19.632: E/AndroidRuntime(23515): Caused by: java.lang.NullPointerException
04-28 21:25:19.632: E/AndroidRuntime(23515):    at com.classroom_app.DeviceDetailFragment.onActivityResult(DeviceDetailFragment.java:109)
04-28 21:25:19.632: E/AndroidRuntime(23515):    at android.app.Activity.dispatchActivityResult(Activity.java:5261)
04-28 21:25:19.632: E/AndroidRuntime(23515):    at android.app.ActivityThread.deliverResults(ActivityThread.java:3300)
04-28 21:25:19.632: E/AndroidRuntime(23515):    ... 11 more
4

1 回答 1

0

在“LaunchGallery”按钮的 onclick 中,将要选择的文件类型从 image/* 更改为 / 这将使您能够选择任何文件.. 同样在“Fileserverasynctask”上删除打开文件以供查看的意图需要一个图像,因此如果收到任何其他文件,程序将崩溃,通过这样做,您将能够将任何文件从客户端发送到 GO 。它将存储在 Fileserverasynctask 中指定的文件夹中

于 2013-06-24T06:47:06.187 回答