android phonegap 页面跳转进度条
来源:互联网 发布:银行表外业务数据 编辑:程序博客网 时间:2024/05/17 06:56
Activity 代码
package nova.pad;import java.util.Timer;import org.apache.cordova.CordovaChromeClient;import org.apache.cordova.CordovaWebView;import org.apache.cordova.CordovaWebViewClient;import org.apache.cordova.DroidGap;import org.apache.cordova.api.CordovaInterface;import android.app.Dialog;import android.graphics.Bitmap;import android.os.Bundle;import android.util.Log;import android.webkit.WebView;import com.example.mobilenova.R;public class MainActivity extends DroidGap implements CordovaInterface {private Dialog loadDialog;@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);loadDialog = new Dialog(MainActivity.this, R.style.dialog);loadDialog.setCancelable(false);loadDialog.setContentView(R.layout.load);super.setIntegerProperty("splashscreen", R.drawable.base_bg);super.loadUrl("file:///android_asset/www/pad/mobile-main.html", 3000);}@Overridepublic void init() {//重新更改phonegap的init 方法CordovaWebView webView = new CordovaWebView(MainActivity.this);this.init(webView, new CordovaWebViewClient(this, webView) {//重写页面加载完成事件@Overridepublic void onPageFinished(WebView arg0, String arg1) {super.onPageFinished(arg0, arg1);endLoad();}//重写页面加载开始事件@Overridepublic void onPageStarted(WebView view, String url, Bitmap favicon) {super.onPageStarted(view, url, favicon);//判断如果是此url 不调用开始方法如果不写此判断程序退出时报错if (url.equals("about:blank")) {} else {startLoad();}}}, new CordovaChromeClient(this, webView) {});}/** * 页面开始加载的时候 * * @param view * @param url */private void startLoad() {if (loadDialog.isShowing()) {} else {loadDialog.show();}}/** * 页面结束加载的时候 * * @param view * @param url */private void endLoad() {if (loadDialog.isShowing()) {loadDialog.cancel();loadDialog.dismiss();}}}
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="1280dip" android:layout_height="727dip" android:layout_gravity="right|center_vertical" android:gravity="right|center_vertical" android:orientation="vertical" > <ProgressBar android:id="@+id/progressBar1" style="?android:attr/progressBarStyleLarge" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="right|center_vertical" android:gravity="right|center_vertical" /></LinearLayout>
Style.xml
<resources> <style name="dialog" parent="@android:style/Theme.Dialog"> <item name="android:windowFullscreen">true</item> <item name="android:windowFrame">@null</item> <item name="android:windowIsFloating">true</item><!--是否浮现在activity之上--> <item name="android:windowIsTranslucent">false</item><!--半透明--> <item name="android:windowNoTitle">true</item><!-- <item name="android:windowBackground">@drawable/cc</item> --> <item name="android:backgroundDimEnabled">false</item> <item name="android:windowBackground">@color/transparent</item><!--背景透明--> <item name="android:backgroundDimAmount">1</item> </style></resources>
0 0
- android phonegap 页面跳转进度条
- phonegap android 进行页面跳转
- 使用phonegap,进行页面跳转
- phonegap+极光推送+页面跳转
- 带进度条的页面跳转
- PhoneGap/jQuery Mobile: 多页面导航跳转
- Android混合开发之Activity类与html页面之间的相互跳转之PhoneGap
- 带进度条的页面js跳转代码
- js实现带有进度条的跳转页面
- phonegap跳转Activity android插件调用原生
- phonegap+jquerymobile:页面跳转出现白屏的解决方案
- phonegap+jquerymobile:页面跳转出现白屏的解决方案
- android 关于页面跳转
- Android页面跳转
- android基础页面跳转
- android基础页面跳转
- android 页面停几秒后跳转
- android页面跳转
- cvRandSetRange() cvRand()
- 属性表 属性详情表 终端表三个表关联关系
- $.each 和$(selector).each()的区别
- 子弹打样互联网为您的孩子
- 子弹对于我的情人节专辑 - 重金属饲料
- android phonegap 页面跳转进度条
- Linux文件共享(一)——进程与打开文件
- Which is better: AMP or SMP?
- 回收站不小心删了的文件怎么恢复
- 如何使用 iOS 7 的 AVSpeechSynthesizer 制作有声书(2)
- 使用config.properties文件
- C++中的 Round(),floor(),ceil()
- c++ new 和 不 new创建出来的对象有什么区别
- MySQL体系结构