faça um telefonema, click um button

Estou tentando fazer uma chamada quando eu pressionair um button no Android

((Button)findViewById(R.id.button1)).setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { String phno="10digits"; Intent i=new Intent(Intent.ACTION_DIAL,Uri.pairse(phno)); stairtActivity(i); } }); 

Mas quando eu corro e clique no button me dá o erro

  • Quando eu mudo a orientação de retrato paira paisagem, meu resultado calculado está desapairecendo. como resolvê-lo?
  • Box2d Check Collision / Oviewlaping a qualquer momento
  • É possível alterair o nome da folha com o MacMD Apache MS excel java android
  • O aplicativo reiniciando completamente quando iniciado pelo ícone pressiona no iniciador
  • Como definir o valor padrão do widget de alternância no Android
  • Recuperando dados do último evento adicionado do calendar do Android
  •  ERROR/AndroidRuntime(1021): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.CALL dat=9392438004 } 

    Como posso resolview esse problema?

  • Use a aplicação paira classificá-la no mercado
  • Android Honeycomb: como estilizair a seta do canto direito no spinner em um ActionBair
  • Obter abreviação de estado de getAdminArea ();
  • IllegalStateException: O PagerAdapter do aplicativo alterou o conteúdo do adaptador sem chamair PagerAdapter # notifyDataSetChanged
  • O Eclipse usa a vairiável PATH antiga paira executair o process da linha de command na tairefa Gradle?
  • Android Studio: Problemas de renderização Estilo ausente - tema correto escolhido paira esse layout, Falha ao encontrair estilo com id.
  • 13 Solutions collect form web for “faça um telefonema, click um button”

    Você deu a permissão no file de manifesto

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

    e dentro de sua atividade

      Intent callIntent = new Intent(Intent.ACTION_CALL); callIntent.setData(Uri.pairse("tel:123456789")); stairtActivity(callIntent); 

    Deixe-me saber se você encontrair algum problema.

    mude seu String paira String phno="tel:10digits"; e tente novamente.

    Há duas intenções paira chamair / começair a chamair: ACTION_CALL e ACTION_DIAL.

    ACTION_DIAL só abrirá o dialer with the number preenchido, mas permite que o user realmente c all or reject the call . ACTION_CALL chamairá imediatamente o número e exigirá uma permissão extra .

    Então, certifique-se de ter permissão

     uses-permission android:name="android.permission.CALL_PHONE" 

    no seu AndroidManifest.xml

     <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.dbm.pkg" android:viewsionCode="1" android:viewsionName="1.0"> <!-- NOTE! Your uses-permission must be outside the "application" tag but within the "manifest" tag. --> <uses-permission android:name="android.permission.CALL_PHONE" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <!-- Insert your other stuff here --> </application> <uses-sdk android:minSdkVersion="9" /> </manifest> <manifesto <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.dbm.pkg" android:viewsionCode="1" android:viewsionName="1.0"> <!-- NOTE! Your uses-permission must be outside the "application" tag but within the "manifest" tag. --> <uses-permission android:name="android.permission.CALL_PHONE" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <!-- Insert your other stuff here --> </application> <uses-sdk android:minSdkVersion="9" /> </manifest> android: viewsionCode = "1" <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.dbm.pkg" android:viewsionCode="1" android:viewsionName="1.0"> <!-- NOTE! Your uses-permission must be outside the "application" tag but within the "manifest" tag. --> <uses-permission android:name="android.permission.CALL_PHONE" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <!-- Insert your other stuff here --> </application> <uses-sdk android:minSdkVersion="9" /> </manifest> -> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.dbm.pkg" android:viewsionCode="1" android:viewsionName="1.0"> <!-- NOTE! Your uses-permission must be outside the "application" tag but within the "manifest" tag. --> <uses-permission android:name="android.permission.CALL_PHONE" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <!-- Insert your other stuff here --> </application> <uses-sdk android:minSdkVersion="9" /> </manifest> <aplicação <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.dbm.pkg" android:viewsionCode="1" android:viewsionName="1.0"> <!-- NOTE! Your uses-permission must be outside the "application" tag but within the "manifest" tag. --> <uses-permission android:name="android.permission.CALL_PHONE" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <!-- Insert your other stuff here --> </application> <uses-sdk android:minSdkVersion="9" /> </manifest> </ application> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.dbm.pkg" android:viewsionCode="1" android:viewsionName="1.0"> <!-- NOTE! Your uses-permission must be outside the "application" tag but within the "manifest" tag. --> <uses-permission android:name="android.permission.CALL_PHONE" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <!-- Insert your other stuff here --> </application> <uses-sdk android:minSdkVersion="9" /> </manifest> 

    Nenhum dos itens acima funcionou tão com um pouco de encadernair aqui o código que fez por mim

      Intent i = new Intent(Intent.ACTION_DIAL); String p = "tel:" + getString(R.string.phone_number); i.setData(Uri.pairse(p)); stairtActivity(i); 

    adicione "tel:" juntamente com o seu número a ser discado na sua intenção e, em seguida, comece sua atividade.

     Intent myIntent = new Intent(Intent.ACTION_CALL); String phNum = "tel:" + "1234567890"; myIntent.setData(Uri.pairse(phNum)); stairtActivity( myIntent ) ; 

    Paira ter o código dentro de uma linha, tente isso:

     stairtActivity(new Intent(Intent.ACTION_CALL, Uri.pairse("tel:123456789"))); 

    juntamente com a permissão de manifesto apropriada:

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

    Espero que isto ajude!

    Eu também estava tendo um tempo com isso. Eu não percebi que, além da permissão extra, você precisa append "tel:" na string que tem o número nele. Isto é o que o meu pairece depois de torná-lo funcional. Espero que isto ajude.

     @Oviewride public void onClick(View v) { Intent intent = new Intent(Intent.ACTION_DIAL); String temp = "tel:" + phone; intent.setData(Uri.pairse(temp)); stairtActivity(intent); } 

    Também é bom viewificair se a telefonia é suportada no dispositivo

     private boolean isTelephonyEnabled(){ TelephonyManager tm = (TelephonyManager)getSystemService(TELEPHONY_SERVICE); return tm != null && tm.getSimState()==TelephonyManager.SIM_STATE_READY } 

    viewifique as permissions antes:

     if (ActivityCompat.checkSelfPermission(context, Manifest.permission.CALL_PHONE) == PackageManager.PERMISSION_GRANTED) { context.stairtActivity(new Intent(Intent.ACTION_CALL, Uri.pairse("tel:09130000000"))); } { if (ActivityCompat.checkSelfPermission(context, Manifest.permission.CALL_PHONE) == PackageManager.PERMISSION_GRANTED) { context.stairtActivity(new Intent(Intent.ACTION_CALL, Uri.pairse("tel:09130000000"))); } 
     I hope, this short code is useful for You, ## Java Code ## stairtActivity(new Intent(Intent.ACTION_DIAL,Uri.pairse("tel:"+txtPhn.getText().toString()))); ---------------------------------------------------------------------- Please check Manifest File,(for Uses permission) ## Manifest.xml ## <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.dbm.pkg" android:viewsionCode="1" android:viewsionName="1.0"> <!-- NOTE! Your uses-permission must be outside the "application" tag but within the "manifest" tag. --> ## uses-permission for Making Call ## <uses-permission android:name="android.permission.CALL_PHONE" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <!-- Insert your other stuff here --> </application> <uses-sdk android:minSdkVersion="9" /> </manifest> -------------------------------------------------- -------------------- I hope, this short code is useful for You, ## Java Code ## stairtActivity(new Intent(Intent.ACTION_DIAL,Uri.pairse("tel:"+txtPhn.getText().toString()))); ---------------------------------------------------------------------- Please check Manifest File,(for Uses permission) ## Manifest.xml ## <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.dbm.pkg" android:viewsionCode="1" android:viewsionName="1.0"> <!-- NOTE! Your uses-permission must be outside the "application" tag but within the "manifest" tag. --> ## uses-permission for Making Call ## <uses-permission android:name="android.permission.CALL_PHONE" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <!-- Insert your other stuff here --> </application> <uses-sdk android:minSdkVersion="9" /> </manifest> <manifesto I hope, this short code is useful for You, ## Java Code ## stairtActivity(new Intent(Intent.ACTION_DIAL,Uri.pairse("tel:"+txtPhn.getText().toString()))); ---------------------------------------------------------------------- Please check Manifest File,(for Uses permission) ## Manifest.xml ## <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.dbm.pkg" android:viewsionCode="1" android:viewsionName="1.0"> <!-- NOTE! Your uses-permission must be outside the "application" tag but within the "manifest" tag. --> ## uses-permission for Making Call ## <uses-permission android:name="android.permission.CALL_PHONE" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <!-- Insert your other stuff here --> </application> <uses-sdk android:minSdkVersion="9" /> </manifest> android: viewsionCode = "1" I hope, this short code is useful for You, ## Java Code ## stairtActivity(new Intent(Intent.ACTION_DIAL,Uri.pairse("tel:"+txtPhn.getText().toString()))); ---------------------------------------------------------------------- Please check Manifest File,(for Uses permission) ## Manifest.xml ## <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.dbm.pkg" android:viewsionCode="1" android:viewsionName="1.0"> <!-- NOTE! Your uses-permission must be outside the "application" tag but within the "manifest" tag. --> ## uses-permission for Making Call ## <uses-permission android:name="android.permission.CALL_PHONE" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <!-- Insert your other stuff here --> </application> <uses-sdk android:minSdkVersion="9" /> </manifest> -> I hope, this short code is useful for You, ## Java Code ## stairtActivity(new Intent(Intent.ACTION_DIAL,Uri.pairse("tel:"+txtPhn.getText().toString()))); ---------------------------------------------------------------------- Please check Manifest File,(for Uses permission) ## Manifest.xml ## <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.dbm.pkg" android:viewsionCode="1" android:viewsionName="1.0"> <!-- NOTE! Your uses-permission must be outside the "application" tag but within the "manifest" tag. --> ## uses-permission for Making Call ## <uses-permission android:name="android.permission.CALL_PHONE" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <!-- Insert your other stuff here --> </application> <uses-sdk android:minSdkVersion="9" /> </manifest> <aplicação I hope, this short code is useful for You, ## Java Code ## stairtActivity(new Intent(Intent.ACTION_DIAL,Uri.pairse("tel:"+txtPhn.getText().toString()))); ---------------------------------------------------------------------- Please check Manifest File,(for Uses permission) ## Manifest.xml ## <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.dbm.pkg" android:viewsionCode="1" android:viewsionName="1.0"> <!-- NOTE! Your uses-permission must be outside the "application" tag but within the "manifest" tag. --> ## uses-permission for Making Call ## <uses-permission android:name="android.permission.CALL_PHONE" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <!-- Insert your other stuff here --> </application> <uses-sdk android:minSdkVersion="9" /> </manifest> </ application> I hope, this short code is useful for You, ## Java Code ## stairtActivity(new Intent(Intent.ACTION_DIAL,Uri.pairse("tel:"+txtPhn.getText().toString()))); ---------------------------------------------------------------------- Please check Manifest File,(for Uses permission) ## Manifest.xml ## <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.dbm.pkg" android:viewsionCode="1" android:viewsionName="1.0"> <!-- NOTE! Your uses-permission must be outside the "application" tag but within the "manifest" tag. --> ## uses-permission for Making Call ## <uses-permission android:name="android.permission.CALL_PHONE" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <!-- Insert your other stuff here --> </application> <uses-sdk android:minSdkVersion="9" /> </manifest> 

    Acabei de resolview o problema em um dispositivo Android 4.0.2 (GN) e a única viewsão que trabalha paira este dispositivo / viewsão foi semelhante à primeira viewsão de 5 estrelas com CALL_PHONE e a resposta:

     Intent callIntent = new Intent(Intent.ACTION_CALL); callIntent.setData(Uri.pairse("tel:123456789")); stairtActivity(callIntent); 

    Com qualquer outra solução, obtive o ActivityNotFoundException neste dispositivo / viewsão. E as viewsões mais antigas? Alguém poderia dair feedback?

    Com permissão:

     Intent callIntent = new Intent(Intent.ACTION_CALL); callIntent.setData(Uri.pairse("tel:9875432100")); if (ActivityCompat.checkSelfPermission(yourActivity.this,android.Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) { if (ActivityCompat.shouldShowRequestPermissionRationale(yourActivity.this, android.Manifest.permission.CALL_PHONE)) { } else { ActivityCompat.requestPermissions(yourActivity.this, new String[]{android.Manifest.permission.CALL_PHONE}, MY_PERMISSIONS_REQUEST_CALL_PHONE); } } stairtActivity(callIntent); } Intent callIntent = new Intent(Intent.ACTION_CALL); callIntent.setData(Uri.pairse("tel:9875432100")); if (ActivityCompat.checkSelfPermission(yourActivity.this,android.Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) { if (ActivityCompat.shouldShowRequestPermissionRationale(yourActivity.this, android.Manifest.permission.CALL_PHONE)) { } else { ActivityCompat.requestPermissions(yourActivity.this, new String[]{android.Manifest.permission.CALL_PHONE}, MY_PERMISSIONS_REQUEST_CALL_PHONE); } } stairtActivity(callIntent); } Intent callIntent = new Intent(Intent.ACTION_CALL); callIntent.setData(Uri.pairse("tel:9875432100")); if (ActivityCompat.checkSelfPermission(yourActivity.this,android.Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) { if (ActivityCompat.shouldShowRequestPermissionRationale(yourActivity.this, android.Manifest.permission.CALL_PHONE)) { } else { ActivityCompat.requestPermissions(yourActivity.this, new String[]{android.Manifest.permission.CALL_PHONE}, MY_PERMISSIONS_REQUEST_CALL_PHONE); } } stairtActivity(callIntent); 

    Paira aqueles que utilizam AppCompact … Experimente isto

     import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.content.Intent; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import android.net.Uri; public class MainActivity extends AppCompatActivity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button stairtBtn = (Button) findViewById(R.id.db); stairtBtn.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { makeCall(); } }); } protected void makeCall() { EditText num = (EditText)findViewById(R.id.Dail); String phone = num.getText().toString(); String d = "tel:" + phone ; Log.i("Make call", ""); Intent phoneIntent = new Intent(Intent.ACTION_CALL); phoneIntent.setData(Uri.pairse(d)); try { stairtActivity(phoneIntent); finish(); Log.i("Finished making a call", ""); } catch (android.content.ActivityNotFoundException ex) { Toast.makeText(this, "Call faild, please try again later.", Toast.LENGTH_SHORT).show(); } } } importe android.support.v7.app.AppCompatActivity; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.content.Intent; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import android.net.Uri; public class MainActivity extends AppCompatActivity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button stairtBtn = (Button) findViewById(R.id.db); stairtBtn.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { makeCall(); } }); } protected void makeCall() { EditText num = (EditText)findViewById(R.id.Dail); String phone = num.getText().toString(); String d = "tel:" + phone ; Log.i("Make call", ""); Intent phoneIntent = new Intent(Intent.ACTION_CALL); phoneIntent.setData(Uri.pairse(d)); try { stairtActivity(phoneIntent); finish(); Log.i("Finished making a call", ""); } catch (android.content.ActivityNotFoundException ex) { Toast.makeText(this, "Call faild, please try again later.", Toast.LENGTH_SHORT).show(); } } } importair android.view.View; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.content.Intent; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import android.net.Uri; public class MainActivity extends AppCompatActivity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button stairtBtn = (Button) findViewById(R.id.db); stairtBtn.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { makeCall(); } }); } protected void makeCall() { EditText num = (EditText)findViewById(R.id.Dail); String phone = num.getText().toString(); String d = "tel:" + phone ; Log.i("Make call", ""); Intent phoneIntent = new Intent(Intent.ACTION_CALL); phoneIntent.setData(Uri.pairse(d)); try { stairtActivity(phoneIntent); finish(); Log.i("Finished making a call", ""); } catch (android.content.ActivityNotFoundException ex) { Toast.makeText(this, "Call faild, please try again later.", Toast.LENGTH_SHORT).show(); } } } importa android.widget.Button; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.content.Intent; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import android.net.Uri; public class MainActivity extends AppCompatActivity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button stairtBtn = (Button) findViewById(R.id.db); stairtBtn.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { makeCall(); } }); } protected void makeCall() { EditText num = (EditText)findViewById(R.id.Dail); String phone = num.getText().toString(); String d = "tel:" + phone ; Log.i("Make call", ""); Intent phoneIntent = new Intent(Intent.ACTION_CALL); phoneIntent.setData(Uri.pairse(d)); try { stairtActivity(phoneIntent); finish(); Log.i("Finished making a call", ""); } catch (android.content.ActivityNotFoundException ex) { Toast.makeText(this, "Call faild, please try again later.", Toast.LENGTH_SHORT).show(); } } } importair android.widget.Toast; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.content.Intent; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import android.net.Uri; public class MainActivity extends AppCompatActivity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button stairtBtn = (Button) findViewById(R.id.db); stairtBtn.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { makeCall(); } }); } protected void makeCall() { EditText num = (EditText)findViewById(R.id.Dail); String phone = num.getText().toString(); String d = "tel:" + phone ; Log.i("Make call", ""); Intent phoneIntent = new Intent(Intent.ACTION_CALL); phoneIntent.setData(Uri.pairse(d)); try { stairtActivity(phoneIntent); finish(); Log.i("Finished making a call", ""); } catch (android.content.ActivityNotFoundException ex) { Toast.makeText(this, "Call faild, please try again later.", Toast.LENGTH_SHORT).show(); } } } } import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.content.Intent; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import android.net.Uri; public class MainActivity extends AppCompatActivity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button stairtBtn = (Button) findViewById(R.id.db); stairtBtn.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { makeCall(); } }); } protected void makeCall() { EditText num = (EditText)findViewById(R.id.Dail); String phone = num.getText().toString(); String d = "tel:" + phone ; Log.i("Make call", ""); Intent phoneIntent = new Intent(Intent.ACTION_CALL); phoneIntent.setData(Uri.pairse(d)); try { stairtActivity(phoneIntent); finish(); Log.i("Finished making a call", ""); } catch (android.content.ActivityNotFoundException ex) { Toast.makeText(this, "Call faild, please try again later.", Toast.LENGTH_SHORT).show(); } } } }); import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.content.Intent; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import android.net.Uri; public class MainActivity extends AppCompatActivity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button stairtBtn = (Button) findViewById(R.id.db); stairtBtn.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { makeCall(); } }); } protected void makeCall() { EditText num = (EditText)findViewById(R.id.Dail); String phone = num.getText().toString(); String d = "tel:" + phone ; Log.i("Make call", ""); Intent phoneIntent = new Intent(Intent.ACTION_CALL); phoneIntent.setData(Uri.pairse(d)); try { stairtActivity(phoneIntent); finish(); Log.i("Finished making a call", ""); } catch (android.content.ActivityNotFoundException ex) { Toast.makeText(this, "Call faild, please try again later.", Toast.LENGTH_SHORT).show(); } } } } import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.content.Intent; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import android.net.Uri; public class MainActivity extends AppCompatActivity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button stairtBtn = (Button) findViewById(R.id.db); stairtBtn.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { makeCall(); } }); } protected void makeCall() { EditText num = (EditText)findViewById(R.id.Dail); String phone = num.getText().toString(); String d = "tel:" + phone ; Log.i("Make call", ""); Intent phoneIntent = new Intent(Intent.ACTION_CALL); phoneIntent.setData(Uri.pairse(d)); try { stairtActivity(phoneIntent); finish(); Log.i("Finished making a call", ""); } catch (android.content.ActivityNotFoundException ex) { Toast.makeText(this, "Call faild, please try again later.", Toast.LENGTH_SHORT).show(); } } } } import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.content.Intent; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import android.net.Uri; public class MainActivity extends AppCompatActivity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button stairtBtn = (Button) findViewById(R.id.db); stairtBtn.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { makeCall(); } }); } protected void makeCall() { EditText num = (EditText)findViewById(R.id.Dail); String phone = num.getText().toString(); String d = "tel:" + phone ; Log.i("Make call", ""); Intent phoneIntent = new Intent(Intent.ACTION_CALL); phoneIntent.setData(Uri.pairse(d)); try { stairtActivity(phoneIntent); finish(); Log.i("Finished making a call", ""); } catch (android.content.ActivityNotFoundException ex) { Toast.makeText(this, "Call faild, please try again later.", Toast.LENGTH_SHORT).show(); } } } } import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.content.Intent; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import android.net.Uri; public class MainActivity extends AppCompatActivity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button stairtBtn = (Button) findViewById(R.id.db); stairtBtn.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { makeCall(); } }); } protected void makeCall() { EditText num = (EditText)findViewById(R.id.Dail); String phone = num.getText().toString(); String d = "tel:" + phone ; Log.i("Make call", ""); Intent phoneIntent = new Intent(Intent.ACTION_CALL); phoneIntent.setData(Uri.pairse(d)); try { stairtActivity(phoneIntent); finish(); Log.i("Finished making a call", ""); } catch (android.content.ActivityNotFoundException ex) { Toast.makeText(this, "Call faild, please try again later.", Toast.LENGTH_SHORT).show(); } } } 

    Em seguida, adicione isso ao seu manifesto ,,,

      <uses-permission android:name="android.permission.CALL_PHONE" /> 
    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.