Answer the question
In order to leave comments, you need to log in
How to add textview with one touch?
Please tell me...
You need to open the alertdialog with edittext with one touch to the screen. After send the text from the edittext to the TextView at the touch location.
private void onDrawTexts(Canvas canvas) {
float dx = Math.abs(mx - mStartX);
float dy = Math.abs(my - mStartY);
if (dx >= TOUCH_TOLERANCE || dy >= TOUCH_TOLERANCE) {
}
}
private void onTouchEventTexts(MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
isDrawing = true;
mStartX = mx;
mStartY = my;
invalidate();
break;
case MotionEvent.ACTION_MOVE:
invalidate();
break;
case MotionEvent.ACTION_UP:
isDrawing = false;
String txt = "0000" ;
mCanvas.drawText (txt, mx,my,mPaintText);
invalidate();
break;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question