0

I have a fragment that handle a button, i want my Activity to be notified when this button is clicked, Thank you for any help

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
hamou amroun
  • 21
  • 1
  • 2

2 Answers2

1

Follow these steps :

1.Create one interface

2.Implement that in your activity

3.Pass its object to your fragment

4.And onclick of that button call Interface's method using that object

Apurva Kolapkar
  • 1,270
  • 2
  • 16
  • 32
0

You can implement Observer Pattern to make such a handler, more info Observer Design Pattern

Bopmaster
  • 61
  • 6