sanjeev
sanjeev

Reputation: 23

Android refresh button

Hai, I am developing an application in Android. In that there is a refresh button. If I click that button, the page needs to be reloaded like when execution begins. Is there any built in method in Android for getting this?

Thanks in Advance

Upvotes: 0

Views: 6264

Answers (2)

edwin rojas
edwin rojas

Reputation: 139

This is a refresh button method, but it works well in my application.

public void refresh(View view){          //refresh is onClick name given to the button
    onRestart();
}

@Override
protected void onRestart() {

    // TODO Auto-generated method stub
    super.onRestart();
    Intent i = new Intent(lala.this, lala.class);  //your class
    startActivity(i);
    finish();

}

Upvotes: 0

Pentium10
Pentium10

Reputation: 207912

In your current activity, launch your activity again, and call finish()

Upvotes: 1

Related Questions