安卓小程序有切后台5秒会出现网络断开

安卓小程序有切后台5秒会出现网络断开,第1张

安卓小程序有切后台5秒会出现网络断开的解决方法如下:

1、点击设置图标,进入设置中心。

2、向下滑动选择“更多应用”,找到出现问题的应用并点击。点击下方的“清除数据”,d出的对话框点击“清除全部数据”。选择重启应用。

3、如果依然没有解决,点击“检查网络设置”,检测手机网络。

imeUpdate: function (e) {

      //实时播放进度 秒数

        var currentTime = parseInt(e.detail.currentTime)

        console.log("视频播放到第" + currentTime + "秒")//查看正在播放时间,以秒为单位

        if(currentTime>300){

          let videoContext = wx.createVideoContext('myVideo', this)

          console.log(videoContext)

          videoContext.pause

          videoContext.seek("1")

          videoContext.pause

          wx.showModal({

            title: '充值提示',

              content: "非会员只能看前五分钟的内容",//提示内容

              confirmColor: '#2EA7E0',//确定按钮的颜色

              showCancel: false,//不显示取消按钮

               success (res) {

              if (res.confirm) {

                 console.log('用户点击确定按钮')

               } else if (res.cancel) {

                 console.log('用户点击取消按钮')

               }

             }

            })

        }

    },

<video  bindtimeupdate="timeUpdate"  id="myVideo" src="{{kino_mazmuni.info.resource_url}}"  initial-time="{{kino_mazmuni.duration_time}}" title="{{kino_mazmuni.info.video_name}}" object-fit="fill"  enable-auto-rotation="true" vslide-gesture="true"  enable-play-gesture="true" auto-pause-if-navigate="true"  show-screen-lock-button="true"  duration="15"   enable-auto-rotation="true" duration="true" show-fullscreen-btn  show-casting-button="true"   autoplay="true"  poster='https://apqak.alkuyi.com/alkuyi_video_poster.png' objectFit="cover" class="bofangqi">

runtime.exec()这个方法返回的是一个java.lang.Process对象即某个进程的对象引用。你可以借助于Process的destroy()方法进行关闭。

至于打开文件,我没有试过你提供的方法,我用的是:

String filepath="C:/123.txt"//文件路径

String exePath = "notepad.exe" + filepath

try{

Process proc=rt.exec(exePath)

Thread.currentThread().sleep(5000)//设置程序休眠5秒

proc.destroy()

}catch(Exception e){

System.out.println("can't find the file!")

}


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/yw/11036042.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-13
下一篇2023-05-13

发表评论

登录后才能评论

评论列表(0条)

    保存