Closed GoogleCodeExporter closed 9 years ago
This may relate to character encoding in the tags.. Or a number of other
things. Is
it possible for you to provide an MP3 which causes this to happen? I will test
on my
mpd/pmix.
Original comment by mafro...@gmail.com
on 19 Jan 2010 at 4:39
It happens with every mp3 I've tried. The other thing is that, as I said, the
name is
rendered perfectly fine when I press the [+] button on the right, so I don't
see the
connection right now.
I'm not at home right now, so I can't send you a sample mp3 right now (I'd have
to find
a "free" mp3 first, anyway ;))
Original comment by Maximili...@gmail.com
on 19 Jan 2010 at 4:46
[deleted comment]
[deleted comment]
[deleted comment]
Mind you I haven't done any Android coding yet but I guess I found the source
of the
disparity:
I looked at this:
http://code.google.com/p/pmix/source/browse/branches/0.4-
beta4/pmix/src/org/pmix/ui/SongsActivity.java
Code for the [+] action:
PlusListener AddListener = new PlusListener() {
@Override
public void OnAdd(CharSequence sSelected, int iPosition)
{
Music music = musics.get(iPosition);
try {
MPDApplication app = (MPDApplication)getApplication();
app.oMPDAsyncHelper.oMPD.getPlaylist().add(music);
MainMenuActivity.notifyUser(String.format(getResources().getString(R.string.song
Added),
sSelected), SongsActivity.this);
} catch (MPDServerException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
};
Code for the standard tapping/selection action:
protected void onListItemClick(ListView l, View v, int position, long id) {
Music music = musics.get(position);
try {
MPDApplication app = (MPDApplication)getApplication();
app.oMPDAsyncHelper.oMPD.getPlaylist().add(music);
MainMenuActivity.notifyUser(String.format(getResources().getString(R.string.song
Added),
music.getName()), SongsActivity.this);
} catch (MPDServerException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
So when pressing [+], instead of calling music.getName() the CharacterSequence
is
acquired differently/directly. That would at least explain why [+] works but
not
tapping the name.
music.getName() seems to return null... It's really strange, because the music
object
is put into the playlist, right? And there the name is fine.
Original comment by Maximili...@gmail.com
on 19 Jan 2010 at 5:09
[deleted comment]
Ok so a fix is quite easily performed by replacing music.getName() with
music.getTitle().
The list you select from is built from the title strings not name:
for (Music music : musics) {
items.add(music.getTitle());
}
So when you press the [+] you get the "title" but when you press the whole
line, you
get the "name" of the Music object. I'm not sure what getName() is supposed to
return
(or what "name" is supposed to be) but here it seems to return null.
I attached the fixed SongsActivity.java
(or is there a write access to the svn?)
It has been tested in the Android emulator and tapping the title now shows the
same
message as when I press [+].
Original comment by Maximili...@gmail.com
on 19 Jan 2010 at 5:51
Attachments:
Looks like you nailed this one maximili. Can you generate a patch file and post
that
here please? Sag can include it when he does some more updates to source tree.
Original comment by mafro...@gmail.com
on 25 Jan 2010 at 12:46
Hi,
Thanks for the patch, I added it and it will be in soon released 0.4...
Original comment by stefan.a...@gmail.com
on 6 Mar 2010 at 10:58
Original issue reported on code.google.com by
Maximili...@gmail.com
on 18 Jan 2010 at 11:04