Skip to content

Instantly share code, notes, and snippets.

public class NetworkLogUtility {
public static void logFailure(Call call, Throwable throwable){
if(call != null){
if (call.isCanceled())
Timber.e("Request was cancelled");
Request request = call.request();
if(request != null){
HttpUrl httpUrl = request.url();
@prcaen
prcaen / MyActivity.java
Created January 8, 2014 09:11
The Android ActionBar Tips
// How make the ActionBar title clickable on Android under API 11 (1/2)
private static final boolean API_LEVEL_UNDER_11 = android.os.Build.VERSION.SDK_INT < 11;
private boolean navigationDrawerEnabled = true; // Useful if your app need navigation drawer
@Override
protected void onCreate(Bundle savedInstanceState) {
if (API_LEVEL_UNDER_11) {
getSupportActionBar().setCustomView(R.layout.partial_actionbar);
getSupportActionBar().setDisplayShowCustomEnabled(true);