Skip to content

Instantly share code, notes, and snippets.

View prabintim's full-sized avatar

Prabin Timsina prabintim

  • Accolade, Inc.
  • Seattle, WA
View GitHub Profile
@laaptu
laaptu / ApiManager.java
Last active December 13, 2016 10:11
Singleton class for RetroFit RestAdapter (Retrofit 1.9.0)
import retrofit.RestAdapter;
/**
* Singleton class for Retrofit RestAdapter and API (Retrofit 1.9.0)
*/
public class ApiManager {
// interface containing HTTP methods as given by Retrofit
private static RegionApi regionApi;
// static adapter to be used in entire app
@Joev-
Joev- / DialogFragmentCallback.md
Last active June 25, 2021 08:43
Getting results from DialogFragment to calling Fragment using Callbacks

##Getting results from DialogFragments to another Fragment.

When setting up the DialogFragment make a call to Fragment.setTargetFragment()
Then from DialogFragment you can access the main fragment with Fragment.getTargetFragment()
Use interfaces to provide the required actions to the calling Fragment.

##Example code.

###AddFriendDialogFragment - Calls back to calling fragment.