2

In iOS, there is a method to reload a viewcontroller without killing it, e.g.

[self.view setNeedsDisplay];

For example, when you change the button title, it will reload automatically.

Are there any similar method in Android?

I found some link such as Reload activity in Android, but it need to finish() it

startActivity(getIntent()); finish();
Community
  • 1
  • 1
Ryan
  • 10,041
  • 27
  • 91
  • 156

1 Answers1

0

For View it's invalidate() or postInvalidate(). You don't need to redraw Activity manually and, in most cases, you don't need to redraw views too (all this stuff OS carrying for you).

If there is something in onCreate or onStart methods of your Activity, that you need to do more than one time for single screen, it's better to rewise your code.

Dmitry Zaytsev
  • 23,650
  • 14
  • 92
  • 146