Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to show ArrayAdapter's text and Icon in list in android?
    text
    copied!<p>I am creating online media player. In which user can create their own playlist. So for each user there is a different list. And in that list there is one Item called Quickmix which is fix and which is at the top of that list. I want to show the icon near Quickmix text and also want to show an Icon near to currently playing playlist name. for showing that list I created one ListView in xml file. and I have created PlayListActivity.java which extends Activity. in that class I have created one ArrayAdapter </p> <pre><code>private ArrayAdapter&lt; String &gt; mPlayListAdapter = null; private ListView mPlayList = null; private String[] mPlayListNames = null; </code></pre> <p>and in onCreate method my code is like</p> <pre><code>setContentView( R.layout.playlist_layout ); mPlayList = new String[array.length ]; for( int i = 0; i &lt; length; i++ ) { mPlayListNames[i] = array[i].mPlayList; } mPlayList = ( ListView )findViewById( R.id.playList ); try { mPlayListAdapter = new ArrayAdapter&lt; String &gt;( this, android.R.layout.simple_list_item_1, mPlayListNames ); mPlayList.setAdapter( mPlayListAdapter ); mPlayList.setOnItemClickListener( mPlayListListener ); } catch( Exception e ) { Intent nextActivityIntent = new Intent( getApplicationContext(), Welcome.class ); finish(); startActivity( nextActivityIntent ); return; } /** * Called when user clicks on any playlist name. This listener starts * playback of that playlist. */ private OnItemClickListener mPlayListListener = new OnItemClickListener() { public void onItemClick( AdapterView&lt;?&gt; parent, View view, int position, long id ) { Intent nextActivityIntent = new Intent( view.getContext(), SomeActivity.class ); //Some code to start SomeActivity } }; </code></pre> <p>I cannot extend ListActivity/any to PlayListActivity.java I can only extend Activity.</p> <p>is there any solution how to do this ?<img src="https://i.stack.imgur.com/0xknq.png" alt="I want o/p like this"></p>
 

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