i need to display contact name when user enter contact number .And click on Show Contact Name Button. My Layout Xml File Content 3 Field 1.Edit Text(where user enter contact no.) 2.Text View(where contact name display when button pressed) 3.Button Here my activity class for better understand
public class ContactNameActivity extends Activity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final Button buttonshow = (Button) findViewById(R.id.button_ShowName);
final EditText textPhoneNo = (EditText) findViewById(R.id.Edittext_Number);
final TextView tv=(TextView)findViewById(R.id.tv_ContactName);
buttonshow.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
//here i need String ContactName
tv.setText(String.valueOf(ContactName));
}
});
}
}