私のプロジェクト開発プラットフォームは google API7 です。2.2 以下のバージョンのデバイスを実行できますが、上記のバージョン 2.3 にインストールすると、SD カードにファイルを保存できません。
これは私のコードです
class ButtonListener implements OnClickListener
{
public void onClick(View v)
{
if (v == startButton)
{
setTitle("Start Recording and transmitting the file");
bar.setMax(second);
updateBarHandler.post(updateThread);
startButton.setVisibility(View.GONE);
exitButton.setVisibility(View.GONE);
stopButton.setVisibility(View.GONE);
}
if (v == stopButton)
{
setTitle("Stop");
handler.removeCallbacks(updateThread);
recorderInstance.setRecording(false);
recorderInstance = null;
startButton.setVisibility(View.VISIBLE);
exitButton.setVisibility(View.VISIBLE);
}
if (v == exitButton)
{
Intent intent = new Intent();
intent.setClass(MyRecorder.this, User.class);
startActivity(intent);
MyRecorder.this.finish();
}
}
}