Click here to Skip to main content
15,893,722 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
The following code is used to call a number through android app.But in real it is not calling a number.is there any problem in it.can any one run it and give me the real changes that i have to do to run it properly in real android device.what are the settings that I have to do to run the app in mobile device or through bluestacks in pc.

Java
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class Phonecall extends Activity {
    /** Called when the activity is first created. */
	 EditText edittext1;  
	 Button button1;  
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        edittext1=(EditText)findViewById(R.id.editText1);  
        button1=(Button)findViewById(R.id.button1);  
        
        button1.setOnClickListener(new OnClickListener(){  
        	  
            @Override  
            public void onClick(View arg0) {  
                String number=edittext1.getText().toString();  
                Intent callIntent = new Intent(Intent.ACTION_CALL);  
                callIntent.setData(Uri.parse("tel:9550053947"+number));  
                startActivity(callIntent);  
            }  
              
        });  
    }
}
Posted
Updated 3-Aug-14 20:56pm
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900