高手快来,一个很有挑战的问题:代码调用外部程序并传参 问题是这样的:我想在代码中特定指定用某flash播放器打开本地的一个swf文件,我应该如何调用这个外部程序,同时把swf文件的路径传递给这个程序让其打开?急用,期待高手解决,谢谢!!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 读取swf文件没弄过,但是有做过利用word阅读器打开word文档的,方法如下:tempfilepath为文件路径,application/msword标明文件格式Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(Uri.parse("file://" + tempfilepath),"application/msword"); startActivity(intent); 这个地方也就格式不一样,相信楼主可以找到合适的方法解决! 楼上的,intent是不行的,swf不是内置的支持格式,一般用webview 2楼的方法可以去试下。把SWF放到HTML再用webview.loadURL(path)打开。 某flash播放器,那你要看人家的播放器有没有提供对外接口了。你想播放swf文件,其实自己写个播放器就可以了。webview.loadUrl("http://10.1.49.137:8080/Good/jsp/main.jsp?name=" + name + "&key=" + key);main.jsp<% String name = request.getParameter("name"); String key = request.getParameter("key"); out.println(key); out.println(name); %> <div align="center"> <object width="600" height="409"> <param name="movie" value="test_jieshou.swf"></param> <param name="flashvars" value="xian=<%= key %>"></param> <param name="allowFullScreen" value="true"></param> <param name="allowscriptaccess" value="always"></param> <embed src="test_jieshou.swf" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="600" height="409" flashvars="xian=<%= key %>"></embed> </object> </div> 关于CTS测试的问题 用过PHPRPC做Android服务器通信的童鞋请进,求教一个错误问题,百思不得其解啊!!! android webview 加载了一个本地的html问题 有谁知道这个控件的实现原理吗? 请问如何防止别人自刷update.zip 最近装sdk时遇到的一个问题ADB not working! 求ExpendableListView 如何去掉系统默认展开图标?谢谢! android rmvb video player 应用崩溃后,应用的Notification如何取消显示? Toast不显示 Spinner怎么设置字体大小? android模拟器,观看DDMS的log信息
tempfilepath为文件路径,application/msword标明文件格式
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse("file://" + tempfilepath),"application/msword"); startActivity(intent);
这个地方也就格式不一样,相信楼主可以找到合适的方法解决!
你想播放swf文件,其实自己写个播放器就可以了。
webview.loadUrl("http://10.1.49.137:8080/Good/jsp/main.jsp?name="
+ name + "&key=" + key);
main.jsp
<%
String name = request.getParameter("name");
String key = request.getParameter("key");
out.println(key);
out.println(name);
%>
<div align="center">
<object width="600" height="409">
<param name="movie"
value="test_jieshou.swf"></param>
<param name="flashvars" value="xian=<%= key %>"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<embed
src="test_jieshou.swf"
type="application/x-shockwave-flash"
allowscriptaccess="always"
allowfullscreen="true" width="600" height="409"
flashvars="xian=<%= key %>"></embed>
</object>
</div>