我的家園
我的家園
導航
首頁
管理
常用鏈接
我的隨筆
我的評論
我的參與
最新評論
我的收藏
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
閱讀(787)
評論(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
主站蜘蛛池模板:
宕昌县
|
博乐市
|
崇义县
|
定陶县
|
黔江区
|
南乐县
|
精河县
|
萝北县
|
田阳县
|
凤山县
|
江达县
|
文山县
|
赤城县
|
全南县
|
崇义县
|
镶黄旗
|
轮台县
|
屯门区
|
玛纳斯县
|
丰镇市
|
观塘区
|
枝江市
|
阜阳市
|
且末县
|
博兴县
|
芮城县
|
平山县
|
龙南县
|
华亭县
|
永福县
|
饶阳县
|
旌德县
|
思茅市
|
历史
|
枝江市
|
酉阳
|
中宁县
|
新竹县
|
邮箱
|
突泉县
|
桓仁
|