Good day. I can not call DialogFragment from canvas . I draw 4 points on the canvas, then I find them, but how, when pressed, can I call a DialogFragment to sign this point, for example !? As it does not work, I need help .... Code:

 @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); canvas.drawPath(path, paint); canvas.drawPath(mpath, mpaint); } @Override public boolean onTouchEvent(MotionEvent event) { float x=event.getX(); float y=event.getY(); switch (event.getAction()){ case MotionEvent.ACTION_DOWN: if (i<4) { path.addCircle(x, y, 30, Path.Direction.CW); point = new Point(x, y); obgect.add(point); poin=false; } else { for (Point o:obgect) { if (x >= ox - 30 && x <= ox + 30 && y >= oy - 30 && y <= oy + 30) { mpath.addCircle(ox, oy, 30, Path.Direction.CW); } } } } i++; invalidate(); return super.onTouchEvent(event); } 
  • format the code yourself next time - Vladyslav Matviienko
  • I do not see that you could not call DialogFragment . I see that you never tried to call him anywhere. Explain where you need it and why. - Vladyslav Matviienko
  • tried this: if (x> = ox - 30 && x <= ox + 30 && y> = oy - 30 && y <= oy + 30) {mpath.addCircle (ox, oy, 30, Path.Direction.CW) ; DialogFragment fragment = new DialogFragment (); fragment.show (getFragentManager (), "DailogFragment"); } - pulsar
  • you need to sign a point or set certain parameters. - pulsar
  • Well, what's the problem? That does not work? This is not obvious - Vladyslav Matviienko

0