Note that there are some explanatory texts on larger screens.

plurals
  1. POplaying a video into a listview in Android
    primarykey
    data
    text
    <p>Something strange here, I am trying to play a video from a listview but the problem is the videoView is not even placed in the list. the stranger part is that I managed to do it twice before without any problem but now can't... And I deleted the previous scripts... here the script:</p> <pre><code>public class Dadapt extends BaseAdapter { public int play = 0; long timeWhenStopped = 0; private String SOURCE = "source track"; // Declare Variables Context context; LayoutInflater inflater; LayoutInflater flat; ArrayList&lt;HashMap&lt;String, String&gt;&gt; data; ImageLoader imageLoader; LoaderImage conteloader; Audio_load audio_load; ImageView im; VideoView video; AlertDialog.Builder builder; HashMap&lt;String, String&gt; resultp = new HashMap&lt;String, String&gt;(); AQuery aq; MediaController mc; public Dadapt(Context context, ArrayList&lt;HashMap&lt;String, String&gt;&gt; arraylist) { this.context = context; data = arraylist; mc = new MediaController(context); video = new VideoView(context); imageLoader = new ImageLoader(context); aq = new AQuery(context); builder = new AlertDialog.Builder(context); // TODO Auto-generated constructor stub } @Override public int getCount() { // TODO Auto-generated method stub return data.size(); } @Override public Object getItem(int position) { // TODO Auto-generated method stub return null; } @Override public long getItemId(int position) { // TODO Auto-generated method stub return 0; } @Override public View getView(int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub final TextView friend; final String type, vids; final LinearLayout lin; final ImageView avatar; final TextView name; final Button mess; final VideoView vid; inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); View itemView = inflater.inflate(R.layout.event_list, parent, false); resultp = data.get(position); vid = (VideoView)itemView.findViewById(R.id.deo); type = resultp.get(Me.TYPE); vids ="http://xxxxxxx.com/" + resultp.get(Me.MEDIA); lin = (LinearLayout) itemView.findViewById(R.id.near); avatar = (ImageView) itemView.findViewById(R.id.event_pic); if (type.equalsIgnoreCase("video")) { mc.setMediaPlayer(vid); vid.setMediaController(mc); vid.setVideoPath(vids); vid.start(); } else { imageLoader.DisplayImage3( "http://xxxxxxxx/" + resultp.get(Me.MEDIA), avatar); } friend = (TextView) itemView.findViewById(R.id.event_title); friend.setText(resultp.get(Me.NAME)); name = (TextView) itemView.findViewById(R.id.event_descr); name.setText(resultp.get(Me.DESCRIPTION)); return itemView; } </code></pre> <p>}</p> <p>What am I doing wrong? The strangest part is that I done it previously twice so maybe a small error I made here...</p> <p>It is like the videoview doesn't even show at all</p> <p>Edit</p> <p>here the XML code</p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_margin="0dp" android:background="@android:drawable/toast_frame" android:orientation="vertical" android:padding="5dp" &gt; &lt;LinearLayout android:id="@+id/near" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#ffffff" android:orientation="vertical" android:padding="5dp" android:paddingTop="0dp" &gt; &lt;ImageView android:id="@+id/event_pic" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="0dp" /&gt; &lt;VideoView android:id="@+id/deo" android:layout_width="match_parent" android:layout_height="match_parent" /&gt; &lt;TextView android:id="@+id/event_title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Large Text" android:textAppearance="?android:attr/textAppearanceLarge" android:textColor="#777777" android:textStyle="italic" /&gt; &lt;TextView android:id="@+id/event_descr" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="TextView" android:textAlignment="inherit" /&gt; &lt;Button android:id="@+id/event_go" style="?android:attr/borderlessButtonStyle" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/show_me" android:textColor="#777777" /&gt; &lt;/LinearLayout&gt; </code></pre> <p></p> <p>on the logcat I see: 12-04 21:12:51.980: D/AbsListView(10157): unregisterIRListener() is called </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload