Box.COM integration with an android app-OAuthActivity-Nullpointerexception?

為{幸葍}努か 提交于 2019-12-05 08:21:28

Like the comments say, we really cannot know without more code what is wrong. But looking closer at the NullPointerException, it seems to be a pretty common problem with OAuth and WebViews. You can see that your OAuthWebView was the null object most likely. This means you probably need to create the web view as you probably never created it.

The sample you speak of might have had the webview built into Android .xml files or in another activity or you forgot that code. Just check it over carefully, and if you can post code. Post code on where you create the OAuthWebView. It seems like after setting up the custom webview OAuthWebView this error should go away.

java.lang.NullPointerException: Attempt to invoke virtual method 'void com.box.boxandroidlibv2.views.OAuthWebView.setAllowShowingRedirectPage(boolean)' on a null object reference

When you get Attempt to invoke virtual method -blahblahblah- on a null object reference look backwards and see what the last function, AKA the virtual method, call was (in your case it was setAllowingShowingRedirectPage(boolean)) and the null object was the object that called that function, OAuthWebView.

This happens twice in your stack trace so very likely that the creation or management of your instance of OAuthWebView is the problem.

I solved this problem by providing redirect_uri as http://localhost in box.com admin console OAuth2 Parameters http://developers.box.com/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!