Use adb logcat, DDMS, or the DDMS perspective in Eclipse to examine
LogCat and look at the stack trace associated with your crash.

On Thu, May 3, 2012 at 10:49 AM, Saurabh vaishnava
<[email protected]> wrote:
> I am trying to generate the DTMF tones but facing an error all time as
> "Application has stopped unexpectedly. Please try again", as i run the
> application. I search a lot but couldn't get rid of it. Pleas Please
> help me out.
>
> The code is as follows :
>
> package com.srb.basics;
>
> import android.app.Activity;
> import android.media.AudioManager;
> import android.media.ToneGenerator;
> import android.os.Bundle;
> import android.view.View;
> import android.widget.Button;
> import static android.media.ToneGenerator.TONE_DTMF_1;
>
> public class myMain extends Activity {
>        ToneGenerator tone;
>        Button buttonTone;
>    /** Called when the activity is first created. */
>    @Override
>    public void onCreate(Bundle savedInstanceState) {
>        super.onCreate(savedInstanceState);
>        setContentView(R.layout.main);
>        int a = AudioManager.STREAM_DTMF;
>        tone = new ToneGenerator(a,100);
>        buttonTone = (Button) findViewById(R.id.Tutorial);
>        buttonTone.setOnClickListener(new View.OnClickListener() {
>
>                        public void onClick(View arg0) {
>                                // TODO Auto-generated method stub
>                                tone.startTone(TONE_DTMF_1, 2000);
>
>                        }
>                });
>    }
> }
>
> Thanks a lot in advance.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en



-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training...At Your Office: http://commonsware.com/training

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to