开发者

Phonegap + JQuery Mobile: Android crash when I click on a link

I've a problem with Phonegap + Android + JQuery Mobile.

Android close my application when I click on a link on the index.html but I don't know why... the console of eclipse doesn't give me any 开发者_运维知识库error.

My Activity:

package it.test.app;

import android.os.Bundle;
import com.phonegap.*;

public class testActivity extends DroidGap {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        super.loadUrl("file:///android_asset/www/index.html");
    }
}

Example of a link in my index.html:

<a href="page_1.htm">Link</a>

I also created the same app for iPhone and iPad and all works right.

Can you help me?

Thanks!!


After speding a lot of time looking for a solution i've found this bug of Android:

http://code.google.com/p/android/issues/detail?id=6593

In poor words Android doesn't like to get via ajax call an html or xml with this tags:

<meta name="viewport" content="width=device-width; initial-scale=1.0 user-scalable=0;" />

<link rel="apple-touch-icon" type="image/png" href="/pics/apple-touch-icon.png" />

and generally all the "special tags" for mobile application.

Without this tags and the "rel" attributes on links all works like a charm.

ADB

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜