安卓手机通话 [英] phone call in android
本文介绍了安卓手机通话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以下代码用于通过Android app调用一个号码。但实际上它并没有调用一个数字。它有任何问题。任何一个运行它并给我真正的改变,我必须做在真正的Android设备中正确运行它。我必须做什么设置才能在移动设备中运行应用程序或通过pc中的蓝色堆栈。
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.
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);
}
});
}
}
推荐答案
这篇关于安卓手机通话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文