Created
April 10, 2019 21:03
-
-
Save louis993546/cda6c55bfdd6fceabda994ffbe8f0e02 to your computer and use it in GitHub Desktop.
This file contains 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
class SomethingActivity extends AppCompatActivity { | |
@Override | |
void onCreate() { | |
super.onCreate(); | |
setContentView(R.layout.activity_something); | |
} | |
@Override | |
void onResume() { | |
retrofitService.someApiEndpoint().enqueue(this); | |
} | |
@Override | |
void onResponse(Call<Something> call, Response<Pojo> response) { | |
//TODO handle your api call here, set some text field, hide some other field | |
} | |
@Override | |
void onFailure(Call<Something> call, Throwable t) { | |
//TODO show some error message, or a toast, or throw it to error logging tool | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment