I found that to refresh an activity you do, finish(); startActivity(getIntent());
However this is possible only if my present class extends Activity class. But my present class extends Fragment class, so how to I refresh it?.
I tried to pass the object of Intent from my MainActivity.java to this class via the constructor but then I was not able to call finish() that way.