Simple html href not working on Android???

Visto 7.136 veces
Saltar al primer mensaje no leído

Chris

no leída,
30 jul 2011, 3:02:1830/7/11
a phonegap
Hello everyone. I'm new to phonegap and looking forward to this group.
I can really use your help!

I can't get a simple <a href='file2.html'>Link</a> link to work on
phonegap for Android. I tried multiple simulators, all kinds of
variations on the link. I know phonegap is working, I followed the
steps from the website and when I add a simple href tag to the Hello
World page they provide as an example, it just goes nowhere! I have
file2.html in the same "www" directory as the index file.

I installed eclipse on Mac and PC with the same results. Using
phonegap for iPhone worked just fine.

Here are some examples I've tried. I did about 20 searches on the
subject and just couldn't find an answer.

<a href="file2.html">test 1</a>
<a href="file2.html">test 2</a>
<a href="assets/www/file2.html">test 3</a>
<a href="android_assets/www/file2.html">test 4</a>
<a href="file:///assets/www/file2.html">test 5</a>

Again, nothing has worked.. the link just sits there.. any help would
be greatly appreciated!!!

eyal

no leída,
30 jul 2011, 4:51:5130/7/11
a phon...@googlegroups.com
What vêrsion of phonegap did you try?
Try the new version 1.0.

Chris

no leída,
30 jul 2011, 9:25:5930/7/11
a phonegap
It is 1.0, I just downloaded it yesterday. In fact, all of the android
software they tell you to install was installed fresh, for the first
time, yesterday on my PC. When I couldn’t get the links to work, I
repeated the same instructions and downloaded the software for my Mac.
Same results! On both machines, the Hello World code they provide
works just fine. JavaScript works. A simple href link to another local
file, within the same directory of the index file, doesn’t work.

Chris

no leída,
30 jul 2011, 15:03:4430/7/11
a phonegap
To follow up, using the emulator, when I click on the link, it is
wrapped in an orange circle. I’ve basically tried every combination of
link syntax and file paths. And as mentioned above, I also tried PC
and Mac.

Is anyone using multiple HTML pages so I at least know it’s possible?
I know JQ and div tags are preferred, but links worked perfectly on
iOS with phonegap and I’m having no luck. Thanks.

Alex Little

no leída,
30 jul 2011, 7:53:2230/7/11
a phonegap
I'm having the same issue with simple href links not working. For info
I am using phonegap 1.0.0 (just downloaded this morning) and am
running on emulator with Android 2.3.3.

Cheers,
Alex

Chris

no leída,
30 jul 2011, 15:43:2430/7/11
a phonegap
Here is a link to an image that shows the code and the results I get..
if if helps anyone..

http://74.208.103.113/pgerror.jpg

Simon MacDonald

no leída,
30 jul 2011, 15:49:1030/7/11
a phon...@googlegroups.com
I'm surprised this isn't working. Can you check to make sure you have
the following tag inside your application tag in your
AndroidManifest.xml:

<activity android:name="com.phonegap.DroidGap"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden">
<intent-filter>
</intent-filter>
</activity>

Simon Mac Donald
http://hi.im/simonmacdonald

> --
> You received this message because you are subscribed to the Google
> Groups "phonegap" group.
> To post to this group, send email to phon...@googlegroups.com
> To unsubscribe from this group, send email to
> phonegap+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/phonegap?hl=en?hl=en
>
> For more info on PhoneGap or to download the code go to www.phonegap.com
>

Chris

no leída,
30 jul 2011, 15:58:1930/7/11
a phonegap
Simon.. wonderful! That worked!!!!

I think you just helped a lot of people out.. nice work!!!

Simon MacDonald

no leída,
30 jul 2011, 16:06:5630/7/11
a phon...@googlegroups.com
Great, glad to help. I'm going to have to pull together a quick post
on how to upgrade your Android app from the 0.9.X to 1.0.0 release of
PhoneGap.

On Sat, Jul 30, 2011 at 3:58 PM, Chris <pmt...@aol.com> wrote:
> Simon.. wonderful! That worked!!!!
>
> I think you just helped a lot of people out.. nice work!!!
>

Alex Little

no leída,
31 jul 2011, 5:10:3131/7/11
a phonegap
Yes - thanks - worked for me too :-)

Cheers,
Alex

Greg

no leída,
2 ago 2011, 1:56:242/8/11
a phonegap
Any solution for users of the phonegap build service? I have the same
problem with local links but the android manifest is built
automatically by the build service.

Simon MacDonald

no leída,
2 ago 2011, 12:16:122/8/11
a phon...@googlegroups.com
Report a problem on the PhoneGap Build support area:

http://community.phonegap.com/nitobi/products/nitobi_phonegap_build?from_gsfn=true

Riyanto Wibowo

no leída,
2 ago 2011, 14:32:532/8/11
a phonegap
Is there any solution for PhoneGap Build service?

I have report this on the PhoneGap Build support area:
http://community.phonegap.com/nitobi/topics/why_link_tag_doesnt_works_in_phonegap_build_anymore

Greg

no leída,
2 ago 2011, 15:45:242/8/11
a phonegap
No official solution from phonegap build service.

You can merge the html files into the index.html file and use
javascript to hide and show the pages as needed.

On Aug 2, 1:32 pm, Riyanto Wibowo <admin.creativebr...@gmail.com>
wrote:
> Is there any solution for PhoneGap Build service?
>
> I have report this on the PhoneGap Build support area:http://community.phonegap.com/nitobi/topics/why_link_tag_doesnt_works...

Riyanto Wibowo

no leída,
2 ago 2011, 23:23:242/8/11
a phonegap
if I merge all that many of my html files into a single html, my app
will so long when loading and make lag

I try to change a href become javascript navigation
<b>&lt;span onClick=&quot;window.location =
'about.html'&quot;&gt;about us&lt;/span&gt;</b>

But it doesn't works too :(

Riyanto Wibowo

no leída,
2 ago 2011, 23:25:492/8/11
a phonegap
if I merge all that many html files into a single html file, it will
make so long when app starting or loading, and also make lag device

I try to change a href become javascript navigation
<span onClick="window.location = 'about.html'">about us</span>

Satin Katiyar

no leída,
31 ago 2011, 18:09:1731/8/11
a phonegap
Hi,

Just checked the code of Phonegap from trunk (as on 1 sep 2011) , in
case of local links starting file:///, Phonegap starts the activity
with url in extras [ If you are looking at Phonegap code, please refer
showWebPage function of DroidGap.java] .

Since most of the times, code to load the default url (using
super.loadUrl("file:///android_asset/www/index.html");) is in onCreate
method of activity, the original URL is again reloaded in the
webview.

To avoid this issue, you may want to load the default url only in case
there is no extra value in "url" key present in the intent. Here's
the snippet that might be useful to you to handle this bug.

You need to place this code inside the onCreate Method of the your
activity.

Bundle bundle = this.getIntent().getExtras();
boolean skipLoadURL = false;

if (bundle != null) {

String url = bundle.getString("url");

if (url != null) {
skipLoadURL=true;
}
}

if(!skipLoadURL)
{
super.loadUrl("file:///android_asset/www/index.html");
}

I checked with a small POC at my end and this seems to be working fine
now with above change.

In case, it does not work at your end, please do let me know and I can
investigate on it further.

Regards,
Satin
(http://kratinmobile.com)

On Aug 3, 8:25 am, Riyanto Wibowo <admin.creativebr...@gmail.com>
wrote:
> if I merge all that many html files into a single html file, it will
> make so long when app starting or loading, and also make lag device
>
> I try to change ahrefbecome javascript navigation

peersaab nadaf

no leída,
20 sept 2011, 11:57:1920/9/11
a phonegap


On Jul 31, 12:49 am, Simon MacDonald <simon.macdon...@gmail.com>
wrote:
> I'm surprised this isn't working.  Can you check to make sure you have
> the following tag inside your application tag in your
> AndroidManifest.xml:
>
>         <activity android:name="com.phonegap.DroidGap"
> android:label="@string/app_name"
> android:configChanges="orientation|keyboardHidden">
>             <intent-filter>
>             </intent-filter>
>         </activity>
>
> Simon Mac Donaldhttp://hi.im/simonmacdonald
>
> should i write this in all project or
<activity android:name="com.phonegap.DroidGap" will be change
according to project name

jesus gonzales

no leída,
17 sept 2014, 6:46:4617/9/14
a phon...@googlegroups.com
Thanks for your help!!

El jueves, 26 de julio de 2012 05:18:43 UTC-5, Hussain Akbar escribió:
Links to files that you place in your source - i.e. assets/www folder - must have a rel attribute:

<a href="file2.html" rel="external">test 1</a>  

Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos