2016-06-08 170 views
0

我有一个类User有几个属性和String调用ID,以便它匹配我的数据库表User。目前我的表User为空。 每当我尝试:Azure移动应用程序:Android.get()导致应用程序冻结

mClient.getTable(User.class).insert(myUser).get(); 

mClient.getTable(User.class).execute().get(); 

白色屏幕和控制台上我的应用程序冻结显示没有错误。在我的catch子句中所做的stackTrace或打印不会显示出来。

唯一的错误,我得到的是:

06-08 23:23:35.287 28469-28469/t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86 

这是我在onCreate方法使用的代码:

User myUser = new User(); 
// fill in myUser's fields but Id. 
new Runnable() { 
     @Override 
     public void run() { 
      try { 
       User myUser2 = mClient.getTable(User.class).insert(myUser).get(); 
       System.out.println("Successfully added the user !"); 
      } catch (Exception e) { 
       e.printStackTrace(); 
      } 
     } 
    }.run(); 

我新的Azure和我找不到任何帮助与我的朋友谷歌。提前致谢。

编辑:这里是整个的logcat:

t2g.com.travel2gather I/art: Not late-enabling -Xcheck:jni (already on) 
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86 
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86 
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86 
t2g.com.travel2gather I/art: System.exit called, status: 1 
t2g.com.travel2gather I/AndroidRuntime: VM exiting with result code 1, cleanup skipped. 
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86 
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86 
t2g.com.travel2gather W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable 
t2g.com.travel2gather D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true 
            [ 06-08 23:19:29.602 24915:24915 D/   ] 
            HostConnection::get() New Host Connection established 0xabead140, tid 24915 
            [ 06-08 23:19:29.665 24915:24962 D/   ] 
            HostConnection::get() New Host Connection established 0xa313a110, tid 24962 
t2g.com.travel2gather I/OpenGLRenderer: Initialized EGL, version 1.4 
t2g.com.travel2gather W/EGL_emulation: eglSurfaceAttrib not implemented 
t2g.com.travel2gather W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa2cee100, error=EGL_SUCCESS 
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86 
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86 
t2g.com.travel2gather W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable 
t2g.com.travel2gather D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true 
            [ 06-08 23:21:25.518 26595:26595 D/   ] 
            HostConnection::get() New Host Connection established 0xabead0c0, tid 26595 
            [ 06-08 23:21:25.587 26595:26642 D/   ] 
            HostConnection::get() New Host Connection established 0xa3134130, tid 26642 
t2g.com.travel2gather I/OpenGLRenderer: Initialized EGL, version 1.4 
t2g.com.travel2gather W/EGL_emulation: eglSurfaceAttrib not implemented 
t2g.com.travel2gather W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa2cc2220, error=EGL_SUCCESS 
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/data/t2g.com.travel2gather/lib 
t2g.com.travel2gather W/art: Suspending all threads took: 11.368ms 
t2g.com.travel2gather E/Surface: getSlotFromBufferLocked: unknown buffer: 0xabea8b30 
t2g.com.travel2gather I/Choreographer: Skipped 40 frames! The application may be doing too much work on its main thread. 
t2g.com.travel2gather W/EGL_emulation: eglSurfaceAttrib not implemented 
t2g.com.travel2gather W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa2cc2220, error=EGL_SUCCESS 
t2g.com.travel2gather W/EGL_emulation: eglSurfaceAttrib not implemented 
t2g.com.travel2gather W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa36a0480, error=EGL_SUCCESS 
t2g.com.travel2gather E/Surface: getSlotFromBufferLocked: unknown buffer: 0xa2971570 
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/data/t2g.com.travel2gather/lib 
t2g.com.travel2gather W/EGL_emulation: eglSurfaceAttrib not implemented 
t2g.com.travel2gather W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa227e720, error=EGL_SUCCESS 
t2g.com.travel2gather W/art: Suspending all threads took: 10.473ms 
t2g.com.travel2gather I/art: Not late-enabling -Xcheck:jni (already on) 
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86 
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86 
t2g.com.travel2gather W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable 
t2g.com.travel2gather I/art: Background partial concurrent mark sweep GC freed 8584(1343KB) AllocSpace objects, 5(1600KB) LOS objects, 39% free, 3MB/6MB, paused 1.655ms total 226.868ms 
t2g.com.travel2gather D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true 
            [ 06-08 23:22:25.364 27456:27456 D/   ] 
            HostConnection::get() New Host Connection established 0xab6d42e0, tid 27456 
t2g.com.travel2gather W/art: Verification of void com.squareup.okhttp.internal.http.HttpEngine.readResponse() took 169.113ms 
         [ 06-08 23:22:25.428 27456:27508 D/   ] 
         HostConnection::get() New Host Connection established 0xab6d48c0, tid 27508 
t2g.com.travel2gather I/OpenGLRenderer: Initialized EGL, version 1.4 
t2g.com.travel2gather W/EGL_emulation: eglSurfaceAttrib not implemented 
t2g.com.travel2gather W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa37d7c80, error=EGL_SUCCESS 
t2g.com.travel2gather W/art: Verification of okio.Source com.squareup.okhttp.internal.http.HttpConnection.newChunkedSource(com.squareup.okhttp.internal.http.HttpEngine) took 157.042ms 
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/data/t2g.com.travel2gather/lib 
t2g.com.travel2gather I/art: Background partial concurrent mark sweep GC freed 107958(3MB) AllocSpace objects, 1(240KB) LOS objects, 40% free, 4MB/6MB, paused 9.332ms total 199.896ms 
t2g.com.travel2gather W/art: Suspending all threads took: 5.557ms 
t2g.com.travel2gather I/art: Background sticky concurrent mark sweep GC freed 70224(2MB) AllocSpace objects, 6(364KB) LOS objects, 0% free, 7MB/7MB, paused 7.961ms total 76.058ms 
t2g.com.travel2gather I/art: Background partial concurrent mark sweep GC freed 11587(629KB) AllocSpace objects, 5(2040KB) LOS objects, 39% free, 5MB/8MB, paused 5.417ms total 20.421ms 
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86 
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86 
t2g.com.travel2gather I/art: Background sticky concurrent mark sweep GC freed 14786(1156KB) AllocSpace objects, 1(20KB) LOS objects, 72% free, 1024KB/3MB, paused 19.184ms total 31.942ms 
t2g.com.travel2gather W/art: Suspending all threads took: 5.952ms 
t2g.com.travel2gather W/art: Suspending all threads took: 6.214ms 
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86 
t2g.com.travel2gather I/art: System.exit called, status: 1 
t2g.com.travel2gather I/AndroidRuntime: VM exiting with result code 1, cleanup skipped. 
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86 
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86 
t2g.com.travel2gather I/art: WaitForGcToComplete blocked for 5.428ms for cause Background 
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86 
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86 
t2g.com.travel2gather I/art: Background sticky concurrent mark sweep GC freed 164(34KB) AllocSpace objects, 0(0B) LOS objects, 22% free, 666KB/856KB, paused 8.272ms total 38.306ms 
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86 
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86 
t2g.com.travel2gather I/art: Background sticky concurrent mark sweep GC freed 6278(406KB) AllocSpace objects, 0(0B) LOS objects, 13% free, 1497KB/1729KB, paused 5.499ms total 20.437ms 

回答

1

天青移动应用:机器人获得()导致应用冻结

因为主叫.run()为方法,而不是通过可运行到Thread

创建Thread

Runnable mRunnable=new Runnable() 
    { 
    // your code here 
    }; 

,并通过mRunnable对象吧:

Thread thread = new Thread(mRunnable); 
thread.start(); 
+0

哎呀,我忘了这一点...谢谢! – Dliix