图片说明分割显示百度地图。运行出来不报错。但是就是用手机点开程序就散退
Map类的成员变量mBaiduMap没有初始化,根据Java语言规范,此时它的值为null。虽然编译并不报错,但运行后对null值的使用会出现问题。
以下为规范中原文
Every variable in a program must have a value before its value is used:
Each class variable, instance variable, or array component is initialized with a default value when it is created
[...] For all reference types, the default value is null.