Calling a number [Android]
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
});
});
精彩评论