HBuilderX

HBuilderX

极客开发工具
uni-app

uni-app

开发一次,多端覆盖
uniCloud

uniCloud

云开发平台
HTML5+

HTML5+

增强HTML5的功能体验
MUI

MUI

上万Star的前端框架

解决安卓全屏“FLAG_FULLSCREEN”状态下“adjustResize”失效,全屏状态下WebView的输入框被软键盘挡住的问题

软键盘

  目前,5+SDK在全屏模式下问题比较多,比如webview的show和hide方法会概率性失效(调用后没反应)、软键盘挡住当前具有焦点的文本输入框等问题。
  本篇文章的意图,希望官方看到后可以引入到5+SDK中,以便解决全屏模式下,软键盘盖住文本框的问题。

  沿着这个问题的线索,可以追溯到:http://code.google.com/p/android/issues/detail?id=5497 ,安卓官方问题回馈帖,这个问题的代号为“5497” ,就这个问题帖的回复来看,该问题困惑了许多人数年之久,问题发布日期“Dec 16, 2009”,现在我在安卓4.4.2环境运行,这个问题依旧存在。在此推荐这其中的一个解决方法,来自:stackoverflow.com,实测有效。


[java] view plaincopy  
public class AndroidBug5497Workaround {  
    // For more information, see https://code.google.com/p/android/issues/detail?id=5497  
    // To use this class, simply invoke assistActivity() on an Activity that already has its content view set.  
    public static void assistActivity (Activity activity) {  
        new AndroidBug5497Workaround(activity);  
    }  
    private View mChildOfContent;  
    private int usableHeightPrevious;  
    private FrameLayout.LayoutParams frameLayoutParams;  
    private AndroidBug5497Workaround(Activity activity) {  
        FrameLayout content = (FrameLayout) activity.findViewById(android.R.id.content);  
        mChildOfContent = content.getChildAt(0);  
        mChildOfContent.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {  
            public void onGlobalLayout() {  
                possiblyResizeChildOfContent();  
            }  
        });  
        frameLayoutParams = (FrameLayout.LayoutParams) mChildOfContent.getLayoutParams();  
    }  
    private void possiblyResizeChildOfContent() {  
        int usableHeightNow = computeUsableHeight();  
        if (usableHeightNow != usableHeightPrevious) {  
            int usableHeightSansKeyboard = mChildOfContent.getRootView().getHeight();  
            int heightDifference = usableHeightSansKeyboard - usableHeightNow;  
            if (heightDifference > (usableHeightSansKeyboard/4)) {  
                // keyboard probably just became visible  
                frameLayoutParams.height = usableHeightSansKeyboard - heightDifference;  
            } else {  
                // keyboard probably just became hidden  
                frameLayoutParams.height = usableHeightSansKeyboard;  
            }  
            mChildOfContent.requestLayout();  
            usableHeightPrevious = usableHeightNow;  
        }  
    }  
    private int computeUsableHeight() {  
        Rect r = new Rect();  
        mChildOfContent.getWindowVisibleDisplayFrame(r);  
        return (r.bottom - r.top);  
    }  
}  

在Activity/Fragment的onCreate()/onCreateView()里调用AndroidBug5497Workaround.assistActivity(Activity);代码搬运,希望能够帮助到各位。

另见:
必须在setContentView()后面添加AndroidBug5497Workaround.assistActivity(this);

Based on yghm is workaround, I coded up a convenience class that allows me to solve the problem with a one-liner (after adding the new class to my source code of course). The one-liner is:  
     AndroidBug5497Workaround.assistActivity(this);  
And the implementation class is:  
public class AndroidBug5497Workaround {  
    // For more information, see https://code.google.com/p/android/issues/detail?id=5497  
    // To use this class, simply invoke assistActivity() on an Activity that already has its content view set.  
    public static void assistActivity (Activity activity) {  
        new AndroidBug5497Workaround(activity);  
    }  
    private View mChildOfContent;  
    private int usableHeightPrevious;  
    private FrameLayout.LayoutParams frameLayoutParams;  
    private AndroidBug5497Workaround(Activity activity) {  
        FrameLayout content = (FrameLayout) activity.findViewById(android.R.id.content);  
        mChildOfContent = content.getChildAt(0);  
        mChildOfContent.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {  
            public void onGlobalLayout() {  
                possiblyResizeChildOfContent();  
            }  
        });  
        frameLayoutParams = (FrameLayout.LayoutParams) mChildOfContent.getLayoutParams();  
    }  
    private void possiblyResizeChildOfContent() {  
        int usableHeightNow = computeUsableHeight();  
        if (usableHeightNow != usableHeightPrevious) {  
            int usableHeightSansKeyboard = mChildOfContent.getRootView().getHeight();  
            int heightDifference = usableHeightSansKeyboard - usableHeightNow;  
            if (heightDifference > (usableHeightSansKeyboard/4)) {  
                // keyboard probably just became visible  
                frameLayoutParams.height = usableHeightSansKeyboard - heightDifference;  
            } else {  
                // keyboard probably just became hidden  
                frameLayoutParams.height = usableHeightSansKeyboard;  
            }  
            mChildOfContent.requestLayout();  
            usableHeightPrevious = usableHeightNow;  
        }  
    }  
    private int computeUsableHeight() {  
        Rect r = new Rect();  
        mChildOfContent.getWindowVisibleDisplayFrame(r);  
        return (r.bottom - r.top);  
    }  
}  
Hope this helps someone.  
继续阅读 »

  目前,5+SDK在全屏模式下问题比较多,比如webview的show和hide方法会概率性失效(调用后没反应)、软键盘挡住当前具有焦点的文本输入框等问题。
  本篇文章的意图,希望官方看到后可以引入到5+SDK中,以便解决全屏模式下,软键盘盖住文本框的问题。

  沿着这个问题的线索,可以追溯到:http://code.google.com/p/android/issues/detail?id=5497 ,安卓官方问题回馈帖,这个问题的代号为“5497” ,就这个问题帖的回复来看,该问题困惑了许多人数年之久,问题发布日期“Dec 16, 2009”,现在我在安卓4.4.2环境运行,这个问题依旧存在。在此推荐这其中的一个解决方法,来自:stackoverflow.com,实测有效。


[java] view plaincopy  
public class AndroidBug5497Workaround {  
    // For more information, see https://code.google.com/p/android/issues/detail?id=5497  
    // To use this class, simply invoke assistActivity() on an Activity that already has its content view set.  
    public static void assistActivity (Activity activity) {  
        new AndroidBug5497Workaround(activity);  
    }  
    private View mChildOfContent;  
    private int usableHeightPrevious;  
    private FrameLayout.LayoutParams frameLayoutParams;  
    private AndroidBug5497Workaround(Activity activity) {  
        FrameLayout content = (FrameLayout) activity.findViewById(android.R.id.content);  
        mChildOfContent = content.getChildAt(0);  
        mChildOfContent.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {  
            public void onGlobalLayout() {  
                possiblyResizeChildOfContent();  
            }  
        });  
        frameLayoutParams = (FrameLayout.LayoutParams) mChildOfContent.getLayoutParams();  
    }  
    private void possiblyResizeChildOfContent() {  
        int usableHeightNow = computeUsableHeight();  
        if (usableHeightNow != usableHeightPrevious) {  
            int usableHeightSansKeyboard = mChildOfContent.getRootView().getHeight();  
            int heightDifference = usableHeightSansKeyboard - usableHeightNow;  
            if (heightDifference > (usableHeightSansKeyboard/4)) {  
                // keyboard probably just became visible  
                frameLayoutParams.height = usableHeightSansKeyboard - heightDifference;  
            } else {  
                // keyboard probably just became hidden  
                frameLayoutParams.height = usableHeightSansKeyboard;  
            }  
            mChildOfContent.requestLayout();  
            usableHeightPrevious = usableHeightNow;  
        }  
    }  
    private int computeUsableHeight() {  
        Rect r = new Rect();  
        mChildOfContent.getWindowVisibleDisplayFrame(r);  
        return (r.bottom - r.top);  
    }  
}  

在Activity/Fragment的onCreate()/onCreateView()里调用AndroidBug5497Workaround.assistActivity(Activity);代码搬运,希望能够帮助到各位。

另见:
必须在setContentView()后面添加AndroidBug5497Workaround.assistActivity(this);

Based on yghm is workaround, I coded up a convenience class that allows me to solve the problem with a one-liner (after adding the new class to my source code of course). The one-liner is:  
     AndroidBug5497Workaround.assistActivity(this);  
And the implementation class is:  
public class AndroidBug5497Workaround {  
    // For more information, see https://code.google.com/p/android/issues/detail?id=5497  
    // To use this class, simply invoke assistActivity() on an Activity that already has its content view set.  
    public static void assistActivity (Activity activity) {  
        new AndroidBug5497Workaround(activity);  
    }  
    private View mChildOfContent;  
    private int usableHeightPrevious;  
    private FrameLayout.LayoutParams frameLayoutParams;  
    private AndroidBug5497Workaround(Activity activity) {  
        FrameLayout content = (FrameLayout) activity.findViewById(android.R.id.content);  
        mChildOfContent = content.getChildAt(0);  
        mChildOfContent.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {  
            public void onGlobalLayout() {  
                possiblyResizeChildOfContent();  
            }  
        });  
        frameLayoutParams = (FrameLayout.LayoutParams) mChildOfContent.getLayoutParams();  
    }  
    private void possiblyResizeChildOfContent() {  
        int usableHeightNow = computeUsableHeight();  
        if (usableHeightNow != usableHeightPrevious) {  
            int usableHeightSansKeyboard = mChildOfContent.getRootView().getHeight();  
            int heightDifference = usableHeightSansKeyboard - usableHeightNow;  
            if (heightDifference > (usableHeightSansKeyboard/4)) {  
                // keyboard probably just became visible  
                frameLayoutParams.height = usableHeightSansKeyboard - heightDifference;  
            } else {  
                // keyboard probably just became hidden  
                frameLayoutParams.height = usableHeightSansKeyboard;  
            }  
            mChildOfContent.requestLayout();  
            usableHeightPrevious = usableHeightNow;  
        }  
    }  
    private int computeUsableHeight() {  
        Rect r = new Rect();  
        mChildOfContent.getWindowVisibleDisplayFrame(r);  
        return (r.bottom - r.top);  
    }  
}  
Hope this helps someone.  
收起阅读 »

关于关闭mui.popover的心得

popover

在使用popover时候,也遇到代码关不了的情况,百度半天,纠结不已;后在烟火之间突有所悟,原来是自己搞错了对象,而非mui问题。后来观之,问题虽简单但我等初学者容易犯错,立此文档,以助后来者使用。上代码:

html代码片段:
<div id='popover' class="mui-popover" style="width:150px;">
<ul id='funcMenuList' class="mui-table-view">
<li class="mui-table-view-cell"><a href="#">上传文件</a></li>
<li class="mui-table-view-cell"><a href="#">新建文件夹</a></li>
<li class="mui-table-view-cell"><a href="#">创建共享</a></li>
</ul>
</div>
响应代码:

mui('#funcMenuList').on('tap','a', function(event){  
     switch(this.innerText){  
           case '上传文件':{  
                 // 处理过程。。。  
                 **mui('#popover').popover('hide');** //<--重点是这里,应该隐藏的ID是popover,而不是funcMenuList,正是在此纠结半天。  
           } bread;  
    }  
}
继续阅读 »

在使用popover时候,也遇到代码关不了的情况,百度半天,纠结不已;后在烟火之间突有所悟,原来是自己搞错了对象,而非mui问题。后来观之,问题虽简单但我等初学者容易犯错,立此文档,以助后来者使用。上代码:

html代码片段:
<div id='popover' class="mui-popover" style="width:150px;">
<ul id='funcMenuList' class="mui-table-view">
<li class="mui-table-view-cell"><a href="#">上传文件</a></li>
<li class="mui-table-view-cell"><a href="#">新建文件夹</a></li>
<li class="mui-table-view-cell"><a href="#">创建共享</a></li>
</ul>
</div>
响应代码:

mui('#funcMenuList').on('tap','a', function(event){  
     switch(this.innerText){  
           case '上传文件':{  
                 // 处理过程。。。  
                 **mui('#popover').popover('hide');** //<--重点是这里,应该隐藏的ID是popover,而不是funcMenuList,正是在此纠结半天。  
           } bread;  
    }  
}
收起阅读 »

【源码技术分享】webpack+vue+html5plus

技术分享 HTML5+

vue 多页面 + HBuilder 打包 + HTML5PLUS 特性

A Vue + H5Plus project

使用UI : Muse-UI 基于 Vue 2.0 和 Material Desigin 的 UI 组件库
真机调试 : HBuilder HBuilder-飞速编码的极客工具

关键字:

1)换肤(支持webview多页面换肤)
2)简易机器人聊天
3)技术性文章浏览
4)支持流应用版本

2017年2月3日 18:33:02

新增主页webview拖拽切换(需要 hbuilder 8.0 版本)

github源码地址

开始

# 安装依赖  
npm install  

# 在服务器上调试 localhost:8080/module/index.html  
npm run dev  
## 然后在HBuilder中起始页设置为 本地服务器:端口号/module/index.html  
### 如 192.168.11.102:8080/module/index.html  
## 手机连接电脑, 在统一局域网下, 开启真机调试  

# 你也可以先 打包  
npm run build  
## 然后把 dist 文件下的目录放入 HBuilder 项目中  
## 设置起始页为 module/index.html 真机调试

扫描二维码
在流应用中快速预览
测试二维码

部分截图

主页

机器人聊天

侧栏

其它

继续阅读 »

vue 多页面 + HBuilder 打包 + HTML5PLUS 特性

A Vue + H5Plus project

使用UI : Muse-UI 基于 Vue 2.0 和 Material Desigin 的 UI 组件库
真机调试 : HBuilder HBuilder-飞速编码的极客工具

关键字:

1)换肤(支持webview多页面换肤)
2)简易机器人聊天
3)技术性文章浏览
4)支持流应用版本

2017年2月3日 18:33:02

新增主页webview拖拽切换(需要 hbuilder 8.0 版本)

github源码地址

开始

# 安装依赖  
npm install  

# 在服务器上调试 localhost:8080/module/index.html  
npm run dev  
## 然后在HBuilder中起始页设置为 本地服务器:端口号/module/index.html  
### 如 192.168.11.102:8080/module/index.html  
## 手机连接电脑, 在统一局域网下, 开启真机调试  

# 你也可以先 打包  
npm run build  
## 然后把 dist 文件下的目录放入 HBuilder 项目中  
## 设置起始页为 module/index.html 真机调试

扫描二维码
在流应用中快速预览
测试二维码

部分截图

主页

机器人聊天

侧栏

其它

收起阅读 »

打包打出个360安全卫士,我擦

360

如题。
此行为很恶劣。

如题。
此行为很恶劣。

写querySelector/querySelectorAll写烦了?进来看看吧...

HTML5 JavaScript 技巧

首先,这个方法不考虑ie9以及同等浏览器以下的兼容问题.....
对了,安卓版本实在低的浏览器也不考虑~(像什么安卓2.3之类的......)
本菜鸡没ios设备,没办法知道兼容情况......

这是废话

讲真的,写querySelector/querySelectorAll写得我不知道多烦躁...
虽然hb或者sublime有文本提示功能...
但是代码量讲真的也是有点大的啊...
好了,废话说了这么多~
来点干的了吧~
先直接上代码...
各位大神献丑了....

document.find = function(selector){  
    return this.querySelector(selector);  
}  
document.findAll = function(selector){  
    return this.querySelectorAll(selector);  
}  
HTMLElement.prototype.find = function(selector){  
    return this.querySelector(selector);  
};  
HTMLElement.prototype.findAll = function(selector){  
    return this.querySelectorAll(selector);  
}

好了.献丑讲下那几个方法的说明吧~~

document.find和document.findAll

js里可以用点(.)来给对象添加方法/属性,没毛病吧~
function里的this指向的就是被添加方法/属性的那个对象~

HTMLElement.prototype.find和HTMLElement.prototype.findAll

HTMLElement是个啥?
我自己通俗的理解就是页面上的像body啊,div啊,p啊...之类的标签在js中的表达方式~
(讲得不对还请大神指正)
具体的点我看W3C的解释吧
prototype又是个啥?
它是js中所有对象都带有的一个属性(不过document和window就没,不知道为啥,还请大神指点),
这个属性可以向对象添加属性/方法
详细的prototype解释看这里
function里的内容见document.find和document.findAll
来点实际的应用吧~

DEMO

    这是部分html代码如下(默认已经把上述js代码保存到script.js中)  
<div class="wrap">  
        <p class="conetent">这是第一段文字</p>  
</div>  
<div class="wrap">  
        <p class="conetent">这是第二段文字</p>  
</div>  
<script src="./js/script.js"></script>
    这是部分js代码
var wrap = document.find('.wrap'),  
        //或者直接document.find('.content'),  
        //我这里写warp.find('.content')是因为有个现成的wrap  
        content = wrap.find('.content'),  
        allWrap = document.findAll('.wrap'),  
        allContent = document.findAll('.conetent');

输出结果

输出结果是啥??
输出结果自己试试吧~

继续阅读 »

首先,这个方法不考虑ie9以及同等浏览器以下的兼容问题.....
对了,安卓版本实在低的浏览器也不考虑~(像什么安卓2.3之类的......)
本菜鸡没ios设备,没办法知道兼容情况......

这是废话

讲真的,写querySelector/querySelectorAll写得我不知道多烦躁...
虽然hb或者sublime有文本提示功能...
但是代码量讲真的也是有点大的啊...
好了,废话说了这么多~
来点干的了吧~
先直接上代码...
各位大神献丑了....

document.find = function(selector){  
    return this.querySelector(selector);  
}  
document.findAll = function(selector){  
    return this.querySelectorAll(selector);  
}  
HTMLElement.prototype.find = function(selector){  
    return this.querySelector(selector);  
};  
HTMLElement.prototype.findAll = function(selector){  
    return this.querySelectorAll(selector);  
}

好了.献丑讲下那几个方法的说明吧~~

document.find和document.findAll

js里可以用点(.)来给对象添加方法/属性,没毛病吧~
function里的this指向的就是被添加方法/属性的那个对象~

HTMLElement.prototype.find和HTMLElement.prototype.findAll

HTMLElement是个啥?
我自己通俗的理解就是页面上的像body啊,div啊,p啊...之类的标签在js中的表达方式~
(讲得不对还请大神指正)
具体的点我看W3C的解释吧
prototype又是个啥?
它是js中所有对象都带有的一个属性(不过document和window就没,不知道为啥,还请大神指点),
这个属性可以向对象添加属性/方法
详细的prototype解释看这里
function里的内容见document.find和document.findAll
来点实际的应用吧~

DEMO

    这是部分html代码如下(默认已经把上述js代码保存到script.js中)  
<div class="wrap">  
        <p class="conetent">这是第一段文字</p>  
</div>  
<div class="wrap">  
        <p class="conetent">这是第二段文字</p>  
</div>  
<script src="./js/script.js"></script>
    这是部分js代码
var wrap = document.find('.wrap'),  
        //或者直接document.find('.content'),  
        //我这里写warp.find('.content')是因为有个现成的wrap  
        content = wrap.find('.content'),  
        allWrap = document.findAll('.wrap'),  
        allContent = document.findAll('.conetent');

输出结果

输出结果是啥??
输出结果自己试试吧~

收起阅读 »

【示例】iOS中使用video标签播放视频,禁止自动全屏的方案

video iOS

iOS中,使用video播放视频默认为全屏。可以通过以下配置,调整为非全屏。

解决方案

前端

video标签中添加playsinline属性

<video controls="controls" playsinline preload="auto">  
</video>

native层

Obj-C中,需要添加配置webview.allowsInlineMediaPlayback = YES;
Swift请查找相关API进行配置。

开发5+App,需要在manifest.json的plus节点下新增allowsInlineMediaPlayback节点为true。

"plus":{  
    "allowsInlineMediaPlayback": true  
}

开发及发布

有此需求的开发者,可下载HBuilder.ipa进行调试,并且使用最新的alpha版HBuilder打包。
alpha版HBuilder下载地址:https://pan.baidu.com/s/1hs0O4eS#list/path=%2F

正式版HBuilder更新后,即可正常使用。

参考

更多相关信息,请参考网上的相关解决办法。
http://stackoverflow.com/questions/3699552/html5-inline-video-on-iphone-vs-ipad-browser
https://www.zhihu.com/question/21094425
http://www.jb51.net/article/72732.htm

继续阅读 »

iOS中,使用video播放视频默认为全屏。可以通过以下配置,调整为非全屏。

解决方案

前端

video标签中添加playsinline属性

<video controls="controls" playsinline preload="auto">  
</video>

native层

Obj-C中,需要添加配置webview.allowsInlineMediaPlayback = YES;
Swift请查找相关API进行配置。

开发5+App,需要在manifest.json的plus节点下新增allowsInlineMediaPlayback节点为true。

"plus":{  
    "allowsInlineMediaPlayback": true  
}

开发及发布

有此需求的开发者,可下载HBuilder.ipa进行调试,并且使用最新的alpha版HBuilder打包。
alpha版HBuilder下载地址:https://pan.baidu.com/s/1hs0O4eS#list/path=%2F

正式版HBuilder更新后,即可正常使用。

参考

更多相关信息,请参考网上的相关解决办法。
http://stackoverflow.com/questions/3699552/html5-inline-video-on-iphone-vs-ipad-browser
https://www.zhihu.com/question/21094425
http://www.jb51.net/article/72732.htm

收起阅读 »

解决plus.zip.compressImage 图片循环压缩无法都压缩完的问题

图片压缩

用for循环 来处理图片压缩 的问题,原因是 plus.zip.compressImage 方法 是异步执行的,for循环很快, 同时手机可执行的压缩方法有限制:应该是3个吧。超出直接就不执行了。所以 原理就是 在图片压缩成功后 继续 回调 压缩函数。 以到达循环压缩图片的功能。

继续阅读 »

用for循环 来处理图片压缩 的问题,原因是 plus.zip.compressImage 方法 是异步执行的,for循环很快, 同时手机可执行的压缩方法有限制:应该是3个吧。超出直接就不执行了。所以 原理就是 在图片压缩成功后 继续 回调 压缩函数。 以到达循环压缩图片的功能。

收起阅读 »

微信小程序跟流应用感觉好像啊

流应用

有没有这种感觉啊

有没有这种感觉啊

webview底部选项卡

可以参考下这篇文章:http://ask.dcloud.net.cn/article/629
希望可以帮到大家

可以参考下这篇文章:http://ask.dcloud.net.cn/article/629
希望可以帮到大家

大半夜的谈谈苹果ATS,刚刚看到审核通过

应用发布

ATS要求出来后鸡飞狗跳,
服务器是阿里云的,阿里云提供免费的证书可用,搞上去
tomcat貌似阿里云官方给的证书部署解决方案有误还是这边问题不清楚,反正后面用tomcat8才搞定,67都没成功。
项目请求地址改为https开头的。
后来在别的论坛看到IPV6什么的苹果也卡,不清楚了,反正提交上去了。
刚刚查的时候发现状态已变为“可供销售”,前天大半夜提交的,前后不到48小时吧。

有这方面顾虑的童鞋放心上吧,一步通过。
hbuilder不错,赞

继续阅读 »

ATS要求出来后鸡飞狗跳,
服务器是阿里云的,阿里云提供免费的证书可用,搞上去
tomcat貌似阿里云官方给的证书部署解决方案有误还是这边问题不清楚,反正后面用tomcat8才搞定,67都没成功。
项目请求地址改为https开头的。
后来在别的论坛看到IPV6什么的苹果也卡,不清楚了,反正提交上去了。
刚刚查的时候发现状态已变为“可供销售”,前天大半夜提交的,前后不到48小时吧。

有这方面顾虑的童鞋放心上吧,一步通过。
hbuilder不错,赞

收起阅读 »

老帖子已经关闭

App mui

老帖子已经关闭

老帖子已经关闭

Huilder这次更新以后map模块闪退

map

之前的代码用new plus.maps.Map好好的,不知道是不是这次修改了百度地图https相关的东西把这个玩意给改坏了,但是自己感觉不可能啊,那怎么解释我这么长时间没动的代码突然就闪退了呢?gps权限也开着,好好的就突然闪退了,能给个解释吗?

之前的代码用new plus.maps.Map好好的,不知道是不是这次修改了百度地图https相关的东西把这个玩意给改坏了,但是自己感觉不可能啊,那怎么解释我这么长时间没动的代码突然就闪退了呢?gps权限也开着,好好的就突然闪退了,能给个解释吗?