天天看點

使用Sencha完成APK局部更新 

<a href="http://blog.51cto.com/attachment/201212/225721359.png" target="_blank"></a>

<a href="http://blog.51cto.com/attachment/201212/225959389.png" target="_blank"></a>

package com.xiaoma.sencha; 

import org.apache.cordova.DroidGap; 

import android.os.Bundle; 

import android.view.Menu; 

import android.view.View; 

import android.view.View.OnClickListener; 

import android.widget.Button; 

import android.widget.CheckBox; 

import android.widget.CompoundButton; 

import android.widget.CompoundButton.OnCheckedChangeListener; 

import android.widget.EditText; 

import com.foreveross.cube.R; 

public class MainActivity extends DroidGap 

    @Override 

    public void onCreate(Bundle savedInstanceState) 

    { 

        super.onCreate(savedInstanceState); 

        // setContentView(R.layout.login); 

        super.loadUrl("sdcard/sencha/init.html"); 

        // initView(); 

    } 

&lt;!DOCTYPE html&gt; 

&lt;html&gt; 

    &lt;head&gt; 

        &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt; 

        &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"/&gt; 

        &lt;script src="assets/js/jquery-1.8.2.min.js"&gt;&lt;/script&gt; 

        &lt;title&gt;應用初始化......&lt;/title&gt; 

    &lt;/head&gt; 

    &lt;body&gt; 

    &lt;div style="display: none;"&gt; 

        &lt;h1&gt;應用初始化&lt;/h1&gt; 

        &lt;!-- 等待對話框 --&gt; 

        &lt;div id="progressModal" class="modal hide"&gt; 

          &lt;div class="modal-header"&gt; 

            &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&amp;times;&lt;/button&gt; 

            &lt;h3&gt;加載中......&lt;/h3&gt; 

          &lt;/div&gt; 

        &lt;/div&gt; 

        &lt;!-- 出錯對話框 --&gt; 

        &lt;div id="errorModal" class="modal hide"&gt; 

            &lt;h3&gt;出錯&lt;/h3&gt; 

          &lt;div class="modal-body"&gt; 

            &lt;p&gt;&lt;/p&gt; 

    &lt;/div&gt; 

    &lt;/body&gt; 

&lt;/html&gt; 

<a href="http://blog.51cto.com/attachment/201212/230631404.png" target="_blank"></a>

<a href="http://blog.51cto.com/attachment/201212/230651963.png" target="_blank"></a>

     本文轉自華華世界 51CTO部落格,原文連結:http://blog.51cto.com/mzh3344258/1086202,如需轉載請自行聯系原作者