mardi 26 mai 2015

Android make phone call by clicking a button not working for Galaxy 5

In my Android application I have to make phone call to a particular number by clicking a button. I had written the following for that, it is working fine in my phone.

The same code is not working for client's mobile, he is having Galaxy 5, is there any reason for this

public void onClick(View v) {
  String number = "123456789";
  Intent intent = new Intent(Intent.ACTION_CALL);
  intent.setData(Uri.parse("tel:" + number));
  startActivity(intent);
}

I had used this also in the manifest

<uses-permission android:name="android.permission.CALL_PHONE" />

Can anyone help me.

Aucun commentaire:

Enregistrer un commentaire