返回列表 發帖
sdCardExist = Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED);

TOP

附件: 您需要登錄才可以下載或查看附件。沒有帳號?註冊

TOP

  1. //getRecordFiles();
  2.         adapter = new ArrayAdapter<String>(this,R.layout.list,recordFiles);
  3.         myListView.setAdapter(adapter);
複製代碼

TOP

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <CheckedTextView
  3.   xmlns:android="http://schemas.android.com/apk/res/android"
  4.   android:layout_width="fill_parent"
  5.   android:layout_height="fill_parent"
  6.   android:textColor="#FFFFFFFF" />
複製代碼

TOP

  1. recButton = (Button) findViewById(R.id.RecBtn);
  2.         stopButton = (Button) findViewById(R.id.StopBtn);
  3.         playButton = (Button) findViewById(R.id.PlayBtn);
  4.         delButton = (Button) findViewById(R.id.DelBtn);
  5.         myListView = (ListView) findViewById(R.id.ListView01);
  6.         myTextView = (TextView) findViewById(R.id.TextView01);
複製代碼

TOP

  1. <ListView
  2.       android:id="@+id/ListView01"
  3.       android:layout_width="wrap_content"
  4.           android:layout_height="wrap_content"
  5.       android:background="#FF000000">
  6.   </ListView>
複製代碼

TOP

  1. private ListView myListView;
  2.         private ArrayList<String> recordFiles;
  3.         private ArrayAdapter<String> adapter;
  4.        
  5.         private MediaRecorder mMediaRecorder;
  6.         private boolean sdCardExist;
  7.         private boolean isStopRecord;
複製代碼

TOP

  1. private TextView myTextView;
  2.         private String strTempFile = "MyVoice_";
  3.         private File myRecAudioFile;
  4.         private File myRecAudioDir;
  5.         private File myPlayFile;
複製代碼

TOP

strings.xml
  1. <resources>
  2.     <string name="app_name">MyRecorder</string>
  3.     <string name="menu_settings">Settings</string>
  4.     <string name="title_activity_main">MainActivity</string>
  5.         <string name="RecLabel">錄音</string>
  6.           <string name="StopLabel">停止</string>
  7.           <string name="PlayLabel">播放</string>
  8.           <string name="DelLabel">刪除</string>
  9. </resources>
複製代碼

TOP

返回列表