当我尝试使用带有loadDataWithBaseURL且PluginState设置为PluginState.ON的嵌入式Flash插件(主要是youtube)将HTML加载到WebView时,我收到了SIGSEGV信号.我能用一个简单的测试用例重现错误.请参阅以下代码:
package ians.android2;
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebSettings;
public class TestAndroid extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
WebView wv = (WebView)findViewById(R.id.webview);
wv.getSettings().setPluginState(WebSettings.PluginState.ON);
String html = "";
html += "<object width=\"620\" height=\"376\">";
html += "<param name=\"movie\" value=\"http://www.youtube.com/v/C4KdcRHoXOA?fs=1&hl=en_US&rel=0\"></param>";
html += "<param name=\"allowFullScreen\" value=\"true\"></param>";
html += "<param name=\"allowscriptaccess\" value=\"always\"></param>";
html += "<embed src=\"http://www.youtube.com/v/C4KdcRHoXOA?fs=1&hl=en_US&rel=0\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"620\" height=\"376\"></embed>";
html += "</object>";
wv.loadDataWithBaseURL("notreal/", html, "text/html", "utf-8", null); …
Run Code Online (Sandbox Code Playgroud) 请参阅下面的测试用例:
$val = floatval("336.00");
$result = 300*1.12;
header("content-type: text/plain");
echo "\$result = 300*1.12 which equals $result\n";
echo "\$val = floatval(\"336.00\") which equals $val\n";
echo "gettype(\$val) = ".gettype($val)."\n";
echo "gettype(\$result) = ".gettype($result)."\n";
echo "gettype(300*1.12) = ".gettype(300*1.12)."\n";
echo "gettype(floatval(\$result)) = ".gettype(floatval($result))."\n";
if ($result == 300*1.12)
echo "\$result == 300*1.12 is true\n";
else
echo "\$result == 300*1.12 is false\n";
if ($result == $val)
echo "(\$result == \$val) \$result == 300*1.12 is true\n";
else
echo "(\$result == \$val) \$result == 300*1.12 is false\n";
Run Code Online (Sandbox Code Playgroud)
您认为最后一个if/else块也会显示为true,对吗?不是这样!查看同一脚本的输出: …