开发者

how to take the text in an array which come from a resource?

this is a part of my code :

 public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
  TextView title_t = new TextView(this);
  title_t.setText("");
  String title = title_t.getText().toString();
  switch(position){



  case 0 : new AlertDialog.Builder(this).setTitle(title).setMessage("blah blah").setNeutralButton("close", new DialogInterface.OnClickListener() {

   @Override
   public void onClick(DialogInterface dialog, int which) {
    // TODO Auto-generated method stub

   }
  }).show();

i want to replace the "" in the title_t.setText("") by a 开发者_开发百科thing that can work. I just want to take the title from the listview which come from a resource. Thanks


i found :

TextView str = new TextView(this);
    str.setText(parent.getItemAtPosition(position).toString());
    String title = str.getText().toString();

it was the parent.getItemAtPosition(position).toString() i needed to find

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜