title: My App is not working in API 23
body: <p>The music app which is <code>&lt;uses-sdk android:minSdkVersion="16" android:targetSdkVersion="23" /&gt;</code>, it works on API 16 , but not in API 23.</p>
  
  <p>The listview is not loaded with songs, it shows empty when checked in API23, working fine in API16.</p>
  
  <p><strong>In API22 also working fine</strong></p>
  
  <pre><code>import java.io.File;
  import java.util.ArrayList;
  import java.util.HashMap;
  
  import android.app.ListActivity;
  import android.content.Context;
  import android.content.Intent;
  import android.graphics.Color;
  import android.os.Bundle;
  import android.os.Environment;
  import android.view.ContextMenu;
  import android.view.MenuInflater;
  import android.view.MenuItem;
  import android.view.View;
  import android.view.inputmethod.InputMethodManager;
  import android.widget.AdapterView;
  import android.widget.AdapterView.OnItemClickListener;
  import android.widget.ListView;
  import android.widget.SearchView;
  import android.widget.SimpleAdapter;
  import android.widget.TextView;
  
  public class PlayListActivity extends ListActivity {
      // Songs list
      public ArrayList&lt;HashMap&lt;String, String&gt;&gt; songsList = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
  
      SearchView sv;
      ListView lv;
      SimpleAdapter adapter;
      ArrayList&lt;HashMap&lt;String, String&gt;&gt; songsListData = new ArrayList&lt;&gt;();
      int songIndex;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.playlist);
  
          sv = (SearchView)findViewById(R.id.searchView);
          int id = sv.getContext().getResources().getIdentifier("android:id/search_src_text", null, null);
          TextView textView = (TextView) sv.findViewById(id);
          textView.setTextColor(Color.WHITE);
          textView.setHintTextColor(Color.LTGRAY);
  
          SongsManager plm = new SongsManager();
          // get all songs from sdcard
          this.songsList = plm.getPlayList(Environment.getExternalStorageDirectory());
  
          if(songsList!=null &amp;&amp; songsList.size()&gt;0) {
              // looping through playlist
              for (int i = 0; i &lt; songsList.size(); i++) {
                  // creating new HashMap
                  HashMap&lt;String, String&gt; song = songsList.get(i);
  
                  // adding HashList to ArrayList
                  songsListData.add(song);
              }
  
              // Adding menuItems to ListView
               adapter = new SimpleAdapter(this, songsListData,
                      R.layout.playlist_item, new String[]{"songTitle"}, new int[]{
                      R.id.songTitle});
  
  
              setListAdapter(adapter);
  
              sv.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
                  @Override
                  public boolean onQueryTextSubmit(String query) {
                      return false;
                  }
  
                  @Override
                  public boolean onQueryTextChange(String newText) {
                      adapter.getFilter().filter(newText);
                      return false;
                  }
              });
              // selecting single ListView item
               lv = getListView();
  
              // register for context menu
              registerForContextMenu(lv);
  
              // listening to single listitem click
              lv.setOnItemClickListener(new OnItemClickListener() {
  
                  @Override
                  public void onItemClick(AdapterView&lt;?&gt; parent, View view,
                                          int position, long id) {
                      // getting listitem index
                      songIndex = position;
  
                      // Starting new intent
                      Intent in = new Intent(getApplicationContext(),
                              MainActivity.class);
                      // Sending songIndex to PlayerActivity
                      in.putExtra("songIndex", songIndex);
                      setResult(100, in);
                      // Closing PlayListView
                      finish();
                  }
              });
          }
  
          sv.setOnQueryTextFocusChangeListener(new View.OnFocusChangeListener() {
              @Override
              public void onFocusChange(final View view, boolean hasFocus) {
                  if (hasFocus) {
                      view.postDelayed(new Runnable() {
                          @Override
                          public void run() {
                              InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
                              imm.showSoftInput(view.findFocus(), 0);
                          }
                      }, 200);
                  }
              }
          });
      }
      //ListView listView = (ListView)findViewById(android.R.id.list);
      @Override
      public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
          super.onCreateContextMenu(menu, v, menuInfo);
  
          MenuInflater inflater = getMenuInflater();
          inflater.inflate(R.menu.playlist_contextmenu,menu);
      }
  
      @Override
      public boolean onContextItemSelected(MenuItem item) {
          AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) item.getMenuInfo();
  
          switch (item.getItemId()){
  
              case R.id.delete_id:
                  songsListData.remove(info.position);
                  String path =  songsList.get(info.position).get("songPath");
                  File filepath = new File(path);
                  filepath.delete();
                  adapter.notifyDataSetChanged();
                  return true;
              default:
                  return super.onContextItemSelected(item);
          }
  
      }
  }
  </code></pre>
  
  <p><strong>Even the Notification icon doesn't show up, it shows empty icon</strong>
  I have used <code>NotificationCompat.Builder</code></p>
  
  <p><strong>ListView</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:orientation="vertical"&gt;
      &lt;SearchView
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:id="@+id/searchView"
          android:background="#242424" //black colour
          android:queryHint="Search..."&gt;
      &lt;/SearchView&gt;
      &lt;ListView
          android:id="@android:id/list"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:divider="@drawable/gradient_horizontal_line"
          android:dividerHeight="1dp"
          android:listSelector="@drawable/list_selector" // balck colour
          android:background="@drawable/list_selector"/&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p><strong>List Item</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"
      android:gravity="center"
      android:background="@drawable/list_selector"
      android:foreground="#EBEBEB"
      android:padding="5dp"&gt;
      &lt;!--android:background="@drawable/list_selector"--&gt;
      &lt;TextView 
          android:id="@+id/songTitle"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:textSize="16dp"
          android:padding="10dp"
          android:background="@drawable/list_selector"
          android:textColor="#FFFFFF"/&gt;  // white colour
      &lt;!--android:color="#f3f3f3"--&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p><strong>list_selector</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  &lt;!-- Selector style for listrow --&gt;
  
      &lt;item 
       android:state_selected="false"
          android:state_pressed="false" 
          android:drawable="@drawable/gradient_bg" /&gt;
      &lt;item android:state_pressed="true" 
          android:drawable="@drawable/gradient_bg_hover" /&gt;
      &lt;item android:state_selected="true"
       android:state_pressed="false" 
          android:drawable="@drawable/gradient_bg_hover" /&gt;
      &lt;/selector&gt;
  </code></pre>
  
  <p><strong>Styles.xml</strong></p>
  
  <pre><code>&lt;resources&gt;
  
      &lt;!-- Base application theme. --&gt;
      &lt;style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"&gt;
          &lt;!-- Customize your theme here. --&gt;
          &lt;item name="colorPrimary"&gt;@color/colorPrimary&lt;/item&gt;
          &lt;item name="colorPrimaryDark"&gt;@color/colorPrimaryDark&lt;/item&gt;
          &lt;item name="colorAccent"&gt;@color/colorAccent&lt;/item&gt;
      &lt;/style&gt;
  
      &lt;style name="AppTheme.NoActionBar"&gt;
          &lt;item name="windowActionBar"&gt;false&lt;/item&gt;
          &lt;item name="windowNoTitle"&gt;true&lt;/item&gt;
      &lt;/style&gt;
  
      &lt;style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" /&gt;
  
      &lt;style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" /&gt;
  
      &lt;style name="btnStyleBlackpearl" parent="@android:style/Widget.Button"&gt;
          &lt;item name="android:textSize"&gt;15sp&lt;/item&gt;
          &lt;item name="android:textStyle"&gt;bold&lt;/item&gt;
          &lt;item name="android:textColor"&gt;#C4C4C4&lt;/item&gt;
          &lt;item name="android:gravity"&gt;center&lt;/item&gt;
          &lt;item name="android:shadowColor"&gt;#000000&lt;/item&gt;
          &lt;item name="android:shadowDx"&gt;1&lt;/item&gt;
          &lt;item name="android:shadowDy"&gt;1&lt;/item&gt;
          &lt;item name="android:shadowRadius"&gt;0.6&lt;/item&gt;
          &lt;item name="android:background"&gt;@drawable/custom_btn_black_pearl&lt;/item&gt;
          &lt;item name="android:padding"&gt;10dip&lt;/item&gt;
      &lt;/style&gt;
  
  &lt;/resources&gt;
  </code></pre>
  
  <p>please guide..</p>
  
  <p><strong>API 16 - working</strong>
  <a href="https://i.stack.imgur.com/ddNiu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ddNiu.png" alt=""></a></p>
  
  <p><strong>API 23 - not working - after turned on storage permission in emulator</strong>
  <a href="https://i.stack.imgur.com/LPs0U.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LPs0U.png" alt="enter image description here"></a></p>