PhoneGap的的Andr​​oid开启新活动PhoneGap、Andr、oid

2023-09-05 00:18:57 作者:雄霸天下

我有满载的PhoneGap的HTML页面。该HTML是我的,是在手机上,让我完全控制了。

I have an html page loaded with PhoneGap. The html is mine and is on the phone, so I have full control of it.

我想点击HTML页面上的链接,打开一个新的活动。

I would like to click on a link on the html page to open a new activity.

例如:

index.html的

index.html

...    
<a class="FullText" href="http://LinkToOpenPage" >Click me to open an activity</a>
...

MainActivity.java

MainActivity.java

...
public void OnReceiveLink(string Link)
{
if (Link=="LinkToOpenPage")
    {
    Intent myIntent = new Intent(view.getContext(), CalledActivity.class);
    startActivity(myIntent);
    }
}
...

有人能帮助我吗?

Can someone help me?

推荐答案

看看这个插件:的http://的SMU。 COM / Android的PhoneGap的-插件