Example usage for android.view InflateException getCause

List of usage examples for android.view InflateException getCause

Introduction

In this page you can find the example usage for android.view InflateException getCause.

Prototype

public synchronized Throwable getCause() 

Source Link

Document

Returns the cause of this throwable or null if the cause is nonexistent or unknown.

Usage

From source file:org.mariotaku.twidere.preference.ThemePreviewPreference.java

@Override
protected View onCreateView(final ViewGroup parent) {
    final Context context = getContext();
    final int themeResource = ThemeUtils.getNoActionBarThemeResource(context);
    final Context theme = new ContextThemeWrapper(context, themeResource);
    final LayoutInflater inflater = LayoutInflater.from(theme);
    try {/* w w  w .j  a  v a  2  s.c  om*/
        final View view = inflater.inflate(R.layout.theme_preview, parent, false);
        setPreviewView(theme, view.findViewById(R.id.theme_preview_content), themeResource);
        return view;
    } catch (InflateException e) {
        if (e.getCause() instanceof InvocationTargetException) {
            e.getCause().getCause().printStackTrace();
        }
        throw e;
    }
}