title: Dialling a number using voice recognition
body: <p>I am trying to make an app which takes the number from voice and dials the number.....Below is My Code..</p>
  
  <pre><code>public class MainActivity extends Activity{
  static int check = 1234;
  Button speak_btn,Dial_btn;
  TextView speechText;
  ArrayList&lt;String&gt; results;
  
  @Override
  
  protected void onCreate(Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main); 
  
  speak_btn = (Button)findViewById(R.id.button_Speak);
  
  speechText = (TextView)findViewById(R.id.SpeechtextView);//Shows the Number to be Dialed
  
  Dial_btn = (Button)findViewById(R.id.button_dial);
  
  
  speak_btn.setOnClickListener(new OnClickListener() {
  
  @Override
  public void onClick(View arg0) {
      // TODO Auto-generated method stub
  startVoiceRecognitionActivity();    
  }
  });
  
  
    Dial_btn.setOnClickListener(new OnClickListener() {
  
     @Override
     public void onClick(View v) {
      // TODO Auto-generated method stub
  
      Intent callIntent = new Intent(Intent.ACTION_CALL);
      callIntent.setData(Uri.parse("tel:"+speechText));
      callIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 
      startActivity(callIntent);
  
  
    }
    });
  
    }
  
    public void startVoiceRecognitionActivity(){
  
  Intent i = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); 
  i.putExtra(RecognizerIntent.EXTRA_PROMPT,"Say A Phone Number!");
  i.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
          RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
   startActivityForResult(i, check);
   }
  
   @Override
  
   protected void onActivityResult(int requestCode, int resultCode, Intent data) {
  // TODO Auto-generated method stub
  
  if(requestCode==check &amp;&amp; resultCode==RESULT_OK){
  
    results = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
  
   speechText.setText(results.get(0));
  
  }
  
  
      super.onActivityResult(requestCode, resultCode, data);
   }  
   }
  </code></pre>
  
  <p>Problem is...Every time I press Dial Button,It dials with same Number("2637643") always.(Even when I don't speak any number).I don't Understand What is going wrong </p>