i am goggling from previous 2 days, how to move text from one position to other in a view mean s if we have set text through TextView.setText() to any specified position initially and after that using my finger touch i want to change the position of text in view means as drag and drop or text move on my finger motion and stop or set where i put off my finger from screen ..can any one have any idea about this ,..i will greatly thanks full to all of u…
TextView textView = (TextView)findViewById(R.id.textView);
// this is the view on which you will listen for touch events
View touchView = findViewById(R.id.touchView);
touchView.setOnTouchListener(new View.OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
}}
}
Use Absolute Layout as parent of textView, to set position of textview, but as its depreciated, you can also use RelativeLayout and set Margins of it dynamically, so you can set your view positioning dynamically anywhere in the layout.