title: Abnormal app crash after screen dimming
body: <p>Well it has been great starting android apps development.<br>
  But heres something new that happened now!<br><br>
  <strong>After the user shows no activity, The app is getting forceclosed by the OS</strong><br><br>
  Something that it is famous for...<br>
  Now this only happens to this screen n not the Main Activity screen<br>
  <strong>I have used ListView for this Playlist Activity<br></strong>
  Now - I want to allow screen dimming, n not Disable it!Whilst keeping the app in memory!
  Plz could any one tell how</p>
  
  <pre><code>protected void onCreate(Bundle savedInstanceState)
  {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_playlist);
      // Show the Up button in the action bar.
      setupActionBar();
      ListView playlistView = (ListView)findViewById(R.string.playlistHolder);
      String[] STAR = { "*" };        
          Uri allsongsuri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
          String selection = MediaStore.Audio.Media.IS_MUSIC + " != 0";
          @SuppressWarnings("deprecation")
          Cursor cursor = managedQuery(allsongsuri, STAR, selection, null, null);
          File musicstorage = new File("assets/music.xml");
       // Create the array list of to do items
              ArrayList&lt;String&gt; playItems = new ArrayList&lt;String&gt;();
              // Create the array adapter to bind the array to the listview
              ArrayAdapter&lt;String&gt; aa;
              aa = new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1,playItems);
              // Bind the array adapter to the listview.
              playlistView.setAdapter(aa);
          if (cursor != null)
          {
              if (cursor.moveToFirst())
              {
                  do
                  {
                      String song_name = cursor.getString(cursor
                              .getColumnIndex(MediaStore.Audio.Media.DISPLAY_NAME));
                      int song_id = cursor.getInt(cursor
                              .getColumnIndex(MediaStore.Audio.Media._ID));
  
                      String fullpath = cursor.getString(cursor
                              .getColumnIndex(MediaStore.Audio.Media.DATA));
  
                      String album_name = cursor.getString(cursor
                              .getColumnIndex(MediaStore.Audio.Media.ALBUM));
                      int album_id = cursor.getInt(cursor
                              .getColumnIndex(MediaStore.Audio.Media.ALBUM_ID));
  
                      String artist_name = cursor.getString(cursor
                              .getColumnIndex(MediaStore.Audio.Media.ARTIST));
                      int artist_id = cursor.getInt(cursor
                              .getColumnIndex(MediaStore.Audio.Media.ARTIST_ID));
                      playItems.add(0, song_name);
                      aa.notifyDataSetChanged();
                  } while (cursor.moveToNext());
              }
              cursor.close();
          }
  }
  </code></pre>