[Solved] Android listview selected item while button click [closed]


First you take the text of the textView in a String and then (I guess you have to send it to other activity if im r8 then do as i do it in the following code)

String xyz = textView.getText().toString();

 button = (Button) findViewById(R.id.button);

    button.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
                        Intent intent = new Intent(YOUR_PRESENT_ACTIVITY.this, YOUR_NEXT_ACTIVITY.class);
intent.putExtra("key", xyz);
startActivity(intent);
}
});

then in your YOUR_NEXT_ACTIVITY

Intent in = getIntent();
String str = in.getStringExtra(("key")); 

3

solved Android listview selected item while button click [closed]