Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package testesempio8.com;
- import java.io.IOException;
- import android.app.Activity;
- import android.os.Bundle;
- import android.util.Log;
- import android.view.View;
- import android.view.View.OnClickListener;
- import android.widget.Button;
- public class Testesempio8Activity extends Activity {
- /** Called when the activity is first created. */
- private final static String ACTIVITY_TAG = "activity 1";
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
- final AudioRecorder recorder = new AudioRecorder("test/tmp.3gp");
- Button startRecButton = (Button) findViewById(R.id.button1);
- startRecButton.setOnClickListener(new OnClickListener() {
- public void onClick(View arg0) {
- Log.i(ACTIVITY_TAG, "start ");
- try {
- //recorder
- recorder.start();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- } );
- // secondo bottone
- Button stopRecButton = (Button) findViewById(R.id.button2);
- stopRecButton.setOnClickListener(new OnClickListener() {
- public void onClick(View arg0) {
- Log.i(ACTIVITY_TAG, "Stop ");
- try {
- recorder.stop();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- } );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement