Can we add header and emptyview simultaneously in listview without listview items ? I have tried but only my headerview is visible emptyview is not visible. or i have to set it by adding one view above and below listview Via:: Listview adding header and emptyview       … Read More

I’m trying to get an image of a “play” icon to appear to the right of a list item I have in a LinearLayout. <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”” xmlns:tools=”” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:orientation=”horizontal” android:padding=”4dp”> <ImageView android:id=”@+id/album_image” android:layout_width=”@dimen/list_item_height” android:layout_height=”@dimen/list_item_height” /> <LinearLayout android:id=”@+id/text_container” android:layout_width=”match_parent” android:layout_height=”match_parent” android:gravity=”center_vertical” android:orientation=”vertical” android:paddingLeft=”16dp”> <TextView android:id=”@+id/artist_name” android:layout_width=”match_parent” android:layout_height=”wrap_content” tools:text=”Artist” /> <TextView android:id=”@+id/song_name” android:layout_width=”match_parent”… Read More

I have this code: public void onClick(View v) { if (mp == null) mp = new MediaPlayer(); try { mp.reset(); AssetFileDescriptor afd; afd = getAssets().openFd(“click.mp3”); mp.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getLength()); mp.prepare(); mp.start(); } catch (IllegalArgumentException | IllegalStateException | IOException e) { e.printStackTrace(); } v.setEnabled(false); final View clicked = v; Handler handler = new Handler(); Runnable runnable =… Read More