-
Notifications
You must be signed in to change notification settings - Fork 585
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
取消按钮点击闪退,自带返回键无问题 #31
Comments
@diguasange 你的initLocation()方法是异步请求定位的话,第一次打开定位城市可能为空;点击取消按钮返回的data是null,先判断下。 |
初次定位为空,打开CityPicker后默认就是定位失败 |
没有显示定位失败,定位城市按钮无显示 |
在onClick()方法中的onLocate()方法,在点击时似乎并未被调用,因为在onLocate()方法内添加Log输出定位城市数据,点击时并无log输出 |
你的cityLocated默认为空的吧,因为你传了LocatedCity,就是已经定位了城市所以点击没反应。还不明白的话加QQ交流群601783167 |
谢谢作者! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
在Fragment中添加定位,按您的方法调用如下
其中,cityLocated,province,cityCode是调用initLocation( )后得到的定位数据。
问题:
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.zaaach.citypicker.model.City.getName()' on a null object reference
错误地方如下图标注(同图一)
The text was updated successfully, but these errors were encountered: