2012-03-08 6 views
0

私はWebViewを持つアプリケーションを持っています。ウェブビューでは、アプリは自分のアプリを起動するリンクを持つインターネットページを別のアクティビティに表示します。私はWebViewはonClickイベントを取得します

<a href="my.special.scheme://other/parameters/here"></a> 

のようなものをやっていたし、すべてがうまく行くが、私はJavaScriptを使用して同じことを行う必要があります。HTMLページで これをやっている:

<html> 
<head> 
<script> 
function redirect(n){ 
window.location = n; 
} 
</script> 
</head> 
<body> 
<button id="target" onClick="redirect('my.special.scheme://other/parameters/here')" >Name</button> 
</body> 
</html> 

何も起こりません。 Androidをご利用の場合1.6

ご提案がありますか?

答えて

0
<html> 
<body> 
<button id="target" onClick="parent.location='my.special.scheme://other/parameters/here'" >Name</button> 
</body> 
</html> 

これを試してください。 :)

関連する問題