Created
May 15, 2017 04:37
-
-
Save sreelallalu/c86ba4ac9322e6570da39c192ae3f8af to your computer and use it in GitHub Desktop.
Activity to Fragment <value sending> using interfce
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //ACTIVITY | |
| RefreshClick refreshClick; | |
| public interface RefreshClick | |
| { | |
| void RefreshM(); | |
| } | |
| ///onclick event | |
| refreshClick.RefreshM(); | |
| //initialize | |
| public void setOnBundleSelected(RefreshClick selectedBundle) { | |
| this.refreshClick = selectedBundle; | |
| } | |
| //FRAGMENT | |
| ((MainActivity)getActivity()).setOnBundleSelected(new MainActivity.RefreshClick() { | |
| @Override | |
| public void RefreshM() { | |
| //do something.... | |
| } | |
| }); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment