Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 73: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 74: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 75: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 76: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 77: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 78: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
package procentris.android.mediaplayer; import java.io.File; import java.io.FilenameFilter; import java.io.IOException; import java.util.ArrayList; import java.util.List; import android.app.ListActivity; import android.media.MediaPlayer; import android.media.MediaPlayer.OnCompletionListener; import android.os.Bundle; import android.view.View; import android.widget.ArrayAdapter; import android.widget.ImageButton; import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; public class mediaplayer extends ListActivity { public ImageButton btn_play; public ImageButton btn_stop; private static final String MEDIA_PATH=new String("/sdcard/"); private List songs= new ArrayList(); private MediaPlayer mp = new MediaPlayer(); private int currentPosition = 0; private int btnst = 0; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); btn_play=(ImageButton) findViewById(R.id.Button01); btn_play.setOnClickListener(new View.OnClickListener(){ public void onClick(View view) { playMe(); } }); btn_stop=(ImageButton)findViewById(R.id.Button02); btn_stop.setOnClickListener(new View.OnClickListener(){ public void onClick(View view){ stopMe(); } }); mp.setOnCompletionListener(new OnCompletionListener(){ public void onCompletion(MediaPlayer mp) { // TODO Auto-generated method stub stopMe(); }}); updateSongList(); } public void updateTime(){ int ttld=mp.getDuration(); int nowd=mp.getCurrentPosition(); int tremaning=(ttld-nowd); String s=getString(tremaning); TextView tv=(TextView) findViewById(R.id.TextView01); tv.setText(s); } public void updateSongList(){ File home=new File(MEDIA_PATH); if(home.listFiles(new Mp3Filter()).length >0){ for (File file:home.listFiles(new Mp3Filter())){ songs.add(file.getName()); ArrayAdapter songList = new ArrayAdapter(this, R.layout.song_item, songs); setListAdapter(songList); getListView().setTextFilterEnabled(true); } } } class Mp3Filter implements FilenameFilter { public boolean accept(File dir, String name) { return (name.endsWith(".mp3")); } } /* (non-Javadoc) * @see android.app.ListActivity#onListItemClick(android.widget.ListView, android.view.View, int, long) */ @Override protected void onListItemClick(ListView l, View v, int position, long id) { currentPosition=position; stopMe(); } private void playMe(){ String songPath=(MEDIA_PATH+songs.get(currentPosition)); try{ if (btnst==0){ mp.reset(); mp.setDataSource(songPath); mp.prepare(); playSong(); }else if(btnst==1){ playSong(); }else if(btnst==2){ pauseSong(); } }catch(IOException e){ String errorString=e.getMessage().toString(); Toast.makeText(this, errorString, 10).show(); } } private void stopMe(){ btnst=0; mp.stop(); mp.release(); btn_play.setImageResource(R.drawable.play); } private void playSong(){ btnst=2; btn_play.setImageResource(R.drawable.pause); mp.start(); } private void pauseSong(){ btnst=1; btn_play.setImageResource(R.drawable.play); mp.pause(); } }