I have two column in relative layout. both column have few button with text. I want to draw a line using finger which join the button. Take the example of "match the following"
like A ------------------- A.
Above things are done. Now i want to get the text of button from where user start drawing the line and end the line. In above case is "A".
Could any one please help me out.
I want to get the text with Orange circle when user start drawing the line from finger and then text of the green circle when user stop the line draw from finger. Text showing inside the circle are button only.
I am using onTouchEvent(MotionEvent event) for drawing line.
I hope now i am able to explain my requirement more
Thanks
public void onClick(View v) {
Button b = (Button)v;
String buttonText = b.getText().toString();
Toast.makeText(getBaseContext(), buttonText , 1000).show();
}
For example, if the View
contains text, use this:
( (TextView) view ).getText().toString();
where view
is being cast to TextView
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With