开发者

Calling a number [Android]

开发者 https://www.devze.com 2023-03-13 13:59 出处:网络
In my app, I want there to be a button where if the user pushes a button, the user gets to pick from a list of lets say 5 numbers and once they pick a number, the number gets called. Soon as the numbe

In my app, I want there to be a button where if the user pushes a button, the user gets to pick from a list of lets say 5 numbers and once they pick a number, the number gets called. Soon as the number is connected, 开发者_如何学Pythonthe app is brought to foreground wile in call so the user can read things off the app.


Button functionality..

button.setOnClickListener(new OnClickListener(){
//if u defined a spinner in xml then follow below step immediately or else create one at run time
spinner = (Spinner )findViewById(//spinner id);
spinner.setAdapter(new ArrayAdapter<Integer>(this,android.R.layout.simple_spinner_item,//your integer array);
spinner.onItemSelectedListener(new OnItemSelectedListener(){
//put your code here

});
});
0

精彩评论

暂无评论...
验证码 换一张
取 消