I need to retrive values from selected items from a listview. I already got the values passed to the layout correctly throughout this listview but always it gets the values at the very first row. Simply I cannot select and pass the value from what I need! Please help me with this. I'm new to android.
public void reuseUnit() {
TextView t1 = (TextView) findViewById(R.id.lblLUnitName);
TextView tg = (TextView) findViewById(R.id.txtG);
TextView t2 = (TextView) findViewById(R.id.lblLNoofBulbs);
TextView t3 = (TextView) findViewById(R.id.lblLNoOfFans);
String name=t1.getText().toString();
Intent RuseName = new Intent(CreateNewUnit.this,
HomePage.class);
;
int gG= Integer.valueOf(tg.getText().toString());
int Rbulb= Integer.valueOf(t2.getText().toString());
int RFans= Integer.valueOf(t3.getText().toString());
RuseName.putExtra("keyRName",name);
RuseName.putExtra("keyG",gG);
RuseName.putExtra("keyRbulbs",Rbulb);
RuseName.putExtra("keyRFans",RFans);
startActivity(RuseName);
0 comments:
Post a Comment