-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
关于接口参数类型 #37
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
如果接口这么定义:
int add(int a, Integer b);
会报异常:
2020-03-01 16:51:58.608 15114-15114/com.hua.myandromeda E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.hua.myandromeda, PID: 15114
java.lang.NullPointerException: Expected to unbox a 'int' primitive type but was returned null
at $Proxy0.add(Unknown Source)
at com.hua.myandromeda.MainActivity$2.onClick(MainActivity.java:31)
at android.view.View.performClick(View.java:6597)
at android.view.View.performClickInternal(View.java:6574)
at android.view.View.access$3100(View.java:778)
at android.view.View$PerformClick.run(View.java:25885)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
点击事件代码:
IApi apiService = InterStellar.with(MainActivity.this).getRemoteService(IApi.class);
int add = apiService.add(4, 5);
The text was updated successfully, but these errors were encountered: