Created
July 11, 2017 06:07
-
-
Save EfeBudak/cf7122858b6f334550b1be1912e021da to your computer and use it in GitHub Desktop.
Application context on Toast message sample
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
public class LoginFragment extends Fragment{ | |
@Inject | |
Context mContext; | |
@Override | |
public void onAttach(Context context) { | |
AndroidSupportInjection.inject(this); | |
super.onAttach(context); | |
} | |
@Override | |
public void showWelcomeMessage(String message) { | |
Toast.makeText(mContext, message, Toast.LENGTH_LONG).show(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment