-1

I have Activity with Action Which have a refresh icon in OnCreateOption Menu.I want to reload my current Activity On click this Icon Click.But I don't know to use here click event.How to resolve this.

Adi
  • 400
  • 8
  • 25

1 Answers1

1

Override onOptionsItemSelected method like this way:

@Override
    public boolean onOptionsItemSelected(final MenuItem item) {
        Intent intent = new Intent();
        switch (item.getItemId()) {
            case R.id.mnuRefresh: // your menu item id
                reCreate();
                break;

        }
        return false;
    }  

There is a good example here :
https://stackoverflow.com/a/7480103/2724418

Community
  • 1
  • 1
YFeizi
  • 1,498
  • 3
  • 28
  • 50