异常汇总

  • java.lang.IllegalStateException: Fragment already active
    说明:当Fragment处于激活状态,使用Fragment.setArguments(bundle)就会跑出该异常
    解决:setArguments()之前,判断Fragment是否可见,Fragment.isVisible();

  • token null is not valid; is your activity running?
    说明:我是在使用SlidingMenu一进入就使用Popupwindow.showAtLocation()方法
    解释:这说明是Activity是否在执行,这个问题的关键是
    you are showing your popup too early. 就是显示的太早了,Activity还没有加载完成

  • has leaked ServiceConnection com.baidu.location.LocationClient$1@40554e10 that was originally bound here
    在使用百度地图时,结束后湖出现的错误
    解决方法:结束
    LocationClient对象,这个原因是LocationClient定位服务没有结束,调用LocationClient.stop()
    如果还有错误,则在service中添加一个标签:
    <service
                android:name="com.baidu.location.f"
                android:enabled="true"
                android:permission="android.permission.BAIDU_LOCATION_SERVICE"
                android:process=":remote" >
                <intent-filter>
                    <action android:name="com.baidu.location.service_v2.6" >
                    </action>
                </intent-filter>
    </service>
     
  • android.os.NetworkOnMainThreadException
    原因上在4.0之后在主线程里面执行Http请求都会报这个错,大概是怕Http请求时间太长造成程序假死的情况吧
    解决方法:
    使用Thread、Runnable、Handler (推荐使用)

  • 使用百度地图java.lang.StringIndexOutOfBoundsException: length=15; regionStart=0; regionLength=-1   bMapManager.init(KEY,new MyGeneralListener());时出现的问题
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值