简体   繁体   中英

android 2.3.5 phonegap app href not working

I have compiled my app using Phonegap build and successfully running the app on android 4.4.3, but when installed on an old 2.3.5 phone although the app runs it does not work on the href elements. I am using handlebars templates and the area of code with the problem is...

<script id="campaign-li-tpl" type="text/x-handlebars-template"> 
    {{#.}}
    <li><a href="#cam/{{this.id}}">{{this.name}}</a></li>
    {{/.}} 
</script>

When the user selects an item from the list the location hash is changed which fires the event to display the appropriate page.

 $(window).on('hashchange', $.proxy(this.route, this));

On android 4.4.3 and also in the browser all is fine. On the 2.3.5 phone, the items respond to touch as I change the background with CSS, but nothing happens.

I compile using phonegap 3.7.0 with min sdk version of 10.

 <preference name="phonegap-version" value="3.7.0" />
 <preference name="android-minSdkVersion" value="10" />

Is there a known issue with older version of android? Is there something I'm missing?

This may or may not work. Also, this is buried in the documentation, but in the Android Platform Guide for Phonegap 3.2.0, you will find - under Requirements and Support

Cordova supports Android 2.2, 2.3, and 4.x. As a general rule, platforms are deprecated as they dip below 5% on Google's distribution dashboard.

Under 3.6.0 (there is no 3.7.0 docs - as of this moment) it says:

Cordova supports Android 2.3.x (Gingerbread, starting with Android API level 10) and 4.x.

SO, CHANGE

<preference name="phonegap-version" value="3.7.0" />

TO

<preference name="phonegap-version" value="3.2.0" />

You may also want to set your android-targetSdkVersion

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM