Home How to get user id in Quickblox using the android SDK?
Reply: 0

How to get user id in Quickblox using the android SDK?

user4853
1#
user4853 Published in May 24, 2018, 11:18 pm

I am trying to to get the user id in quickblox, but this is not working for me this is the error log:

at android.app.ActivityThread.main(ActivityThread.java:7331)
                  at java.lang.reflect.Method.invoke(Native Method)
                  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
               Caused by: java.lang.RuntimeException: Unable to start activity ComponentInfo{myapplication3.dor.benmoshe.capp/myapplication3.dor.benmoshe.capp.Home}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Integer com.quickblox.users.model.QBUser.getId()' on a null object reference
                  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3319)
                  at android.app.ActivityThread.startActivityNow(ActivityThread.java:3016)
                  at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:136)
                  at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:348)
                  at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:765)
                  at android.widget.TabHost.setCurrentTab(TabHost.java:424)
                  at android.widget.TabHost.addTab(TabHost.java:258)
                  at myapplication3.dor.benmoshe.capp.HomeTab.onCreate(HomeTab.java:66)
                  at android.app.Activity.performCreate(Activity.java:6904)
                  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1136)
                  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3266)
                  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3415) 
                  at android.app.ActivityThread.access$1100(ActivityThread.java:229) 
                  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821) 
                  at android.os.Handler.dispatchMessage(Handler.java:102) 
                  at android.os.Looper.loop(Looper.java:148) 
                  at android.app.ActivityThread.main(ActivityThread.java:7331) 
                  at java.lang.reflect.Method.invoke(Native Method) 
                  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) 
                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) 
               Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Integer com.quickblox.users.model.QBUser.getId()' on a null object reference
                  at myapplication3.dor.benmoshe.capp.Home.onCreate(Home.java:79)
                  at android.app.Activity.performCreate(Activity.java:6904)
                  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1136)
                  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3266)
                  at android.app.ActivityThread.startActivityNow(ActivityThread.java:3016) 
                  at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:136) 
                  at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:348) 
                  at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:765) 
                  at android.widget.TabHost.setCurrentTab(TabHost.java:424) 
                  at android.widget.TabHost.addTab(TabHost.java:258) 
                  at myapplication3.dor.benmoshe.capp.HomeTab.onCreate(HomeTab.java:66) 
                  at android.app.Activity.performCreate(Activity.java:6904) 
                  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1136) 
                  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3266) 
                  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3415) 
                  at android.app.ActivityThread.access$1100(ActivityThread.java:229) 
                  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821) 
                  at android.os.Handler.dispatchMessage(Handler.java:102) 
                  at android.os.Looper.loop(Looper.java:148) 
                  at android.app.ActivityThread.main(ActivityThread.java:7331) 
                  at java.lang.reflect.Method.invoke(Native Method) 
                  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) 
                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) 

I/Process: Sending signal. PID: 11027 SIG: 9 Application terminated.

I cannot figure it out, please help.

Thank you.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.329024 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO