You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tasks/astrid/src/main/java/com/todoroo/astrid/ui/ErrorCatchingSpinner.java

34 lines
802 B
Java

/**
* Copyright (c) 2012 Todoroo Inc
*
* See the file "LICENSE" for the full license governing this code.
*/
package com.todoroo.astrid.ui;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.Spinner;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ErrorCatchingSpinner extends Spinner {
private static final Logger log = LoggerFactory.getLogger(ErrorCatchingSpinner.class);
public ErrorCatchingSpinner(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
protected void onDetachedFromWindow() {
try {
super.onDetachedFromWindow();
} catch (IllegalArgumentException e) {
// Bad times
log.error(e.getMessage(), e);
}
}
}