I have a list view that has links to media files, it works fine but without the mediacontroller, after applying a mediacontroller I'm not able to select another item from the list during the appearance of the mediacontroller, I can only scrolling the listview but I can't select any item. how can I make the list view selectable during the appearance of the Mediacontroller?
Note: It works while mediacontroller is hidden.
Note2: the media controller is shown all the time during the playing of the media file.
Thanks
[EDIT]
Here is my layout code, please see the return button (that button is clickable), but the list of items isn't...
.....
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:id="@+id/main_audio_player"
android:orientation="horizontal"
></LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="100dp"
>
<Button
android:layout_width="150dp"
android:layout_height="50dp"
android:text="Return"
android:id="@+id/btnReturn"
android:clickable="true"
android:layout_marginTop="10dp"
>
</Button>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/lvPlaylist"
android:alpha="0.3">
</ListView>
</LinearLayout>
</LinearLayout>
</LinearLayout>
.....
[EDIT 2]
Here is my onPrepared function
public void onPrepared(MediaPlayer mediaPlayer) {
try {
mediaController.setMediaPlayer(this);
mediaController.setAnchorView(findViewById(R.id.main_audio_player));
handler.post(new Runnable() {
public void run() {
mediaController.setEnabled(true);
mediaController.show();
}
});
}
catch (Exception mediaError)
{
Toast error = Toast.makeText(getApplicationContext(),"Media player error!",1000);
error.show();
}
}
and also here is my function for playing the sound...
public void PlayAudioFile(String filename){
if(!emptyList){
if(IsPlayed)
{
mediaPlayer.stop();
mediaPlayer.release();
}
Integer fileIndex =0;
if(filename != ""){
fileIndex = myPlaylist.GetIndexByFilename(filename);
}
mediaPlayer = new MediaPlayer();
if(myPlaylist.GetNumberOfItems()>0)
{
try {
audioFile = myPlaylist.GetItemWithPathInPlaylistByPositionId(fileIndex);
audioName = myPlaylist.GetItemInPlaylistByPositionId(fileIndex);
((TextView)findViewById(R.id.now_playing_text)).setText(audioName);
mediaPlayer.setOnPreparedListener(this);
mediaController = new MediaController(this);
}
catch (Exception errorPlayer){
}
try {
mediaPlayer.setDataSource(audioFile);
mediaPlayer.prepare();
mediaPlayer.start();
IsPlayed = true;
} catch (IOException e) {
}
}
}
}
I hope that is enough for you to give me some suggestions what to do :)