我的家園
我的家園
導航
首頁
管理
常用鏈接
我的隨筆
我的評論
我的參與
最新評論
我的收藏
1
2
www.javady.com
www.javady.com
最新評論
1.?re: CXF 入門:創建一個基于WS-Security標準的安全驗證(CXF回調函數使用,)
@qping
寫的真好,項目中要用,我試了一下,可以!萬分感謝!!!
--李虎鵬
2.?re: HTML的target屬性中_blank、_self、_parent、_top含義[未登錄]
111
--1
3.?re: CXF 入門:創建一個基于WS-Security標準的安全驗證(CXF回調函數使用,)
謝謝~
--qping
4.?re: CXF 入門:創建一個基于WS-Security標準的安全驗證(CXF回調函數使用,)[未登錄]
好文章!
--hello
5.?re: CXF 入門:創建一個基于SOAPHeader的安全驗證(CXF攔截器使用)
樓主,soapheader 驗證未通過,只能以拋出異常的方式防止繼續訪問webservice?
--jaja1900
Android VideoView播放視頻
Posted on 2012-04-15 16:37
zljpp
閱讀(785)
評論(0)
編輯
收藏
Android 利用自帶VideoView控件播放視頻
Activity
public class Activity01 extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); final VideoView videoView = (VideoView) findViewById(R.id.VideoView01); Button PauseButton = (Button) this.findViewById(R.id.PauseButton); Button LoadButton = (Button) this.findViewById(R.id.LoadButton); Button PlayButton = (Button) this.findViewById(R.id.PlayButton); // load LoadButton.setOnClickListener(new OnClickListener() { public void onClick(View arg0) { // videoView.setVideoPath("/sdcard/test.mp4"); videoView.setVideoPath("android.resource://com.homer/"+R.raw.china); videoView.setMediaController(new MediaController(Activity01.this)); videoView.requestFocus(); } }); // play PlayButton.setOnClickListener(new OnClickListener() { public void onClick(View arg0) { videoView.start(); } }); // pause PauseButton.setOnClickListener(new OnClickListener() { public void onClick(View arg0) { videoView.pause(); } }); } }
main.xml
<?xml version="1.0" encoding="utf-8"?> <AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" /> <VideoView android:id="@+id/VideoView01" android:layout_width="320px" android:layout_height="240px" /> <Button android:id="@+id/LoadButton" android:layout_width="80px" android:layout_height="wrap_content" android:layout_x="30px" android:layout_y="300px" android:text="裝載" /> <Button android:id="@+id/PlayButton" android:layout_width="80px" android:layout_height="wrap_content" android:layout_x="120px" android:layout_y="300px" android:text="播放" /> <Button android:id="@+id/PauseButton" android:layout_width="80px" android:layout_height="wrap_content" android:layout_x="210px" android:layout_y="300px" android:text="暫停" /> </AbsoluteLayout>
運行效果:
源碼下載
新用戶注冊
刷新評論列表
只有注冊用戶
登錄
后才能發表評論。
網站導航:
博客園
IT新聞
Chat2DB
C++博客
博問
管理
Powered by:
BlogJava
Copyright © zljpp
主站蜘蛛池模板:
云林县
|
台山市
|
北安市
|
甘泉县
|
大冶市
|
巍山
|
邹城市
|
镶黄旗
|
高唐县
|
县级市
|
沽源县
|
泗洪县
|
青岛市
|
芜湖市
|
四会市
|
恩平市
|
亳州市
|
通州区
|
夏河县
|
万宁市
|
山东省
|
喀喇沁旗
|
玛多县
|
佛山市
|
石台县
|
威信县
|
邵武市
|
通渭县
|
宁南县
|
湖州市
|
龙陵县
|
翁牛特旗
|
获嘉县
|
陕西省
|
洞头县
|
石景山区
|
日照市
|
蒙阴县
|
西平县
|
喜德县
|
赫章县
|