[Java for Android App Development] AmatuerAppDeveloper:
Right before i start, i have looked absolutely everywhere for the answer but there's only so much that people talk about so this is my last hope because I've tried and tried but simply can't do it!

Now i understand that to some this may be a very very easy thing to do and although i have learnt a hell of a lot since i started developing, I'm just not a pro (Just yet)

So basically ever since i started my music player, I've had one big problem and that's trying to list music albums and the songs, now, I have code that does work but it simply doesn't go with my apps data source so I'm trying to the code that i done but the code that I done doesn't show the list of songs, becauser it crashes

Here's the code so far:

public class AlbumsList extends ListActivity{

public ArrayList<HashMap<String,String>> albumsList = new ArrayList<HashMap<String, String>>();
ListView musiclist;
int songAlbum;
int count;
int songPath;
private Cursor cursor;

@Override
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.albums);

ArrayList<HashMap<String, String>> albumListData = new ArrayList<HashMap<String, String>>();

final AlbumsList plm = new AlbumsList();

// get all songs from sdcard

this.albumsList = plm.getPlayList(this, count);

// looping through playlist
for (int i = 0; i < albumsList.size(); i++) {
// creating new HashMap
HashMap<String, String> album = albumsList.get(i);
// adding HashList to ArrayList
albumListData.add(album);

}

// Adding menuItems to ListView
ListAdapter adapter = new SimpleAdapter(this, albumListData,
android.R.layout.simple_list_item_1, new String[] { "songAlbum", "songTitle", "orderBy", "songPath", "where", "whereVal" }, new int[] {
android.R.id.text1});

setListAdapter(adapter);

}

public ArrayList<HashMap<String, String>> getPlayList(Context c, int position) {

final String[] columns = { BaseColumns._ID,
AlbumColumns.ALBUM };

final Cursor mCursor = c.getContentResolver().query(MediaStore.Audio.Albums.EXTERNAL_CONTENT_URI,
columns, null, null, null);

String songAlbum = "";

if (mCursor.moveToFirst()) {
do {

mCursor.getString(mCursor.getColumnIndexOrThrow(BaseColumns._ID));
songAlbum = mCursor.getString(mCursor.getColumnIndexOrThrow(AudioColumns.ALBUM));
HashMap<String, String> album = new HashMap<String, String>();

album.put("songAlbum", songAlbum);
albumsList.add(album);

} while (mCursor.moveToNext());

}
return albumsList;
}

@Override
protected void onListItemClick(ListView lv, View v, int position, long id) {
if(cursor.moveToPosition(position)){

cursor = getContentResolver().query(
MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,
new String[] { MediaColumns.TITLE, MediaColumns.DATA, AudioColumns.ALBUM, BaseColumns._ID }, null, null,
"LOWER(" + MediaColumns.TITLE + ") ASC");

String where = AudioColumns.ALBUM
+ "=?";

String whereVal = cursor.getString(cursor.getColumnIndex(AlbumColumns.ALBUM));

String orderBy = MediaColumns.TITLE;

String songTitle = MediaColumns.TITLE;

String songPath = cursor.getString(cursor.getColumnIndexOrThrow(MediaColumns.DATA));

HashMap<String, String> album = new HashMap<String, String>();

album.put("songTitle", songTitle);
album.put("where", where);
album.put("whereVal", whereVal);
album.put("orderBy", orderBy);
album.put("songPath", songPath);
albumsList.add(album);

}else{

}
}
}

That Code successfully gets all the albums but it won't get the songs from the selected album

Here's the LogCat:

03-18 18:42:21.579: E/AndroidRuntime(10214):	at dalvik.system.NativeStart.main(Native Method)
03-18 18:46:48.223: E/SpannableStringBuilder(12325): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
03-18 18:46:48.223: E/SpannableStringBuilder(12325): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
03-18 18:46:48.894: E/AndroidRuntime(12325): FATAL EXCEPTION: main
03-18 18:46:48.894: E/AndroidRuntime(12325): java.lang.NullPointerException
03-18 18:46:48.894: E/AndroidRuntime(12325):	at com.simplistic.simplisticmusicfree.AlbumsList.onListItemClick(AlbumsList.java:93)
03-18 18:46:48.894: E/AndroidRuntime(12325):	at android.app.ListActivity$2.onItemClick(ListActivity.java:319)
03-18 18:46:48.894: E/AndroidRuntime(12325):	at android.widget.AdapterView.performItemClick(AdapterView.java:301)
03-18 18:46:48.894: E/AndroidRuntime(12325):	at android.widget.AbsListView.performItemClick(AbsListView.java:1519)
03-18 18:46:48.894: E/AndroidRuntime(12325):	at android.widget.AbsListView$PerformClick.run(AbsListView.java:3291)
03-18 18:46:48.894: E/AndroidRuntime(12325):	at android.widget.AbsListView$1.run(AbsListView.java:4340)
03-18 18:46:48.894: E/AndroidRuntime(12325):	at android.os.Handler.handleCallback(Handler.java:725)
03-18 18:46:48.894: E/AndroidRuntime(12325):	at android.os.Handler.dispatchMessage(Handler.java:92)
03-18 18:46:48.894: E/AndroidRuntime(12325):	at android.os.Looper.loop(Looper.java:137)
03-18 18:46:48.894: E/AndroidRuntime(12325):	at android.app.ActivityThread.main(ActivityThread.java:5328)
03-18 18:46:48.894: E/AndroidRuntime(12325):	at java.lang.reflect.Method.invokeNative(Native Method)
03-18 18:46:48.894: E/AndroidRuntime(12325):	at java.lang.reflect.Method.invoke(Method.java:511)
03-18 18:46:48.894: E/AndroidRuntime(12325):	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
03-18 18:46:48.894: E/AndroidRuntime(12325):	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
03-18 18:46:48.894: E/AndroidRuntime(12325):	at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:126)
03-18 18:46:48.894: E/AndroidRuntime(12325):	at dalvik.system.NativeStart.main(Native Method)

Also just in case your wondering, this is music player in question: https://play.google.com/store/apps/details?id=com.simplistic.simplisticmusicfree

So yeah please for the love of god, help!!!