zoukankan      html  css  js  c++  java
  • sencha touch + Cordova 生成打包 解决安卓4.1之上启动系统白屏问题

    直接代码,搬运...

     1 package com.example.jy110;
     2 
     3 import org.apache.cordova.DroidGap;
     4 
     5 import android.annotation.TargetApi;
     6 import android.os.Bundle;
     7 
     8 
     9 public class Jy110Activity extends DroidGap {
    10     private int retryCount = 0;
    11     @Override
    12     public void onCreate(Bundle savedInstanceState) {
    13         super.onCreate(savedInstanceState);
    14         super.setIntegerProperty("splashscreen", R.drawable.splash);
    15         super.init();
    16         if(android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
    17             fixJellyBeanIssues();
    18         }
    19         super.loadUrl("file:///android_asset/www/index.html",5000);
    20     }
    21 
    22     @TargetApi(16)
    23     protected void fixJellyBeanIssues() {
    24         System.out.println(super.appView.toString());
    25         try {
    26             super.appView.getSettings().setAllowUniversalAccessFromFileURLs(true);
    27         } catch(NullPointerException e) {
    28             System.out.println(e.toString());
    29         }
    30     }
    31 
    32     @Override
    33     public void onReceivedError( int errorCode, String description, String failingUrl)
    34     {
    35         if(retryCount < 3) {
    36             retryCount++;
    37             super.loadUrl("file:///android_asset/www/index.html");
    38         } else {
    39             super.loadUrl("file:///android_asset/www/fail.html");
    40         }
    41         return;
    42     }
    43 
    44 }
  • 相关阅读:
    Django remedy a security issue refer dos attack
    AppScan8.7的两个细节亮点
    redis的使用
    IDEA使用技巧
    记录tips
    Scala实现wordcount
    Scala学习笔记1
    linux系统下访问window本地数据库
    python国内使用豆瓣下载源和linux常用的命令
    hadoop集群开启和停止执行命令
  • 原文地址:https://www.cnblogs.com/mlzs/p/3131539.html
Copyright © 2011-2022 走看看