i 想建立一种方法,在一点点点点击时,便可开播,标题和案文是自动的,例如:
public void Display(String test){
new AlertDialog.Builder(this).setTitle(getTitle()).setMessage(test).setNeutralButton("close", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}
}).show();
}
but test is a String and set Message doesn t accept Strings, and it would come from a resource XML, like Strings.xml. So i don t know ho to do this. And the getTitle() i don t think it could work. My method to take the title is this one.
TextView str = new TextView(this);
str.setText(parent.getItemAtPosition(position).toString());
String title = str.getText().toString();