Trying to get value out of text view in list view click event in android

感情迁移 提交于 2019-11-29 08:03:47

This should do it.

TextView tv = (TextView)view.findViewById(R.id.txt_Genius);
String genus = tv.getText().toString();

Then put it into the intent extras, I think you already know this bit.

i.putExtra("genius", genius);

Edit;

In your new activity you would access the intent and get the extras bundle. You can then access anything you placed in the intent on your previous activity like below;

Bundle extras = getIntent().getExtras();
String genius = extras.getString("genius");
// pop some toast to show the value of genius - not required but shows it works :) 
Toast.makeText(this, "Genius value: " + genius, Toast.LENGTH_SHORT).show();
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!