0

We use bitmap class for imageview_and I want know what the class for videoview instead bitmap?

3
  • Try to make better your question, show what you tried to do in code.. if not i think this question would be closed Commented Apr 8, 2017 at 20:06
  • I want created on activity instead of many activity for my Listview'item Commented Apr 8, 2017 at 20:08
  • In other hand we use a bitmap class for imageview_what the class for video view instead of bitmap Commented Apr 8, 2017 at 20:11

1 Answer 1

1

**Example of VideoView **

MainActivity.java

 private VideoView videoView; private Button videoPlay; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); videoView = (VideoView)findViewById(R.id.VideoView); videoPlay=(Button)findViewById(R.id.button); videoPlay.setOnClickListener(this); } @Override public void onClick(View v) { if(v==videoPlay){ videoView.setVideoPath("/sdcard/blonde_secretary.3gp"); videoView.start(); } } 

main.xml

 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/activity_main" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context="com.example.videotest.MainActivity"> <VideoView android:id="@+id/videoview" android:layout_width="300dp" android:layout_height="200dp"/> <Button android:text="Play" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/videoview" android:onClick="onButtonClick" android:id="@+id/button"/> </RelativeLayout> 

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.