Java Code Examples for android.view.InflateException#printStackTrace()

The following examples show how to use android.view.InflateException#printStackTrace() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GSYVideoView.java    From GSYVideoPlayer with Apache License 2.0 6 votes vote down vote up
protected void initInflate(Context context) {
    try {
        View.inflate(context, getLayoutId(), this);
    } catch (InflateException e) {
        if (e.toString().contains("GSYImageCover")) {
            Debuger.printfError("********************\n" +
                    "*****   注意   *****" +
                    "********************\n" +
                    "*该版本需要清除布局文件中的GSYImageCover\n" +
                    "****  Attention  ***\n" +
                    "*Please remove GSYImageCover from Layout in this Version\n" +
                    "********************\n");
            e.printStackTrace();
            throw new InflateException("该版本需要清除布局文件中的GSYImageCover,please remove GSYImageCover from your layout");
        } else {
            e.printStackTrace();
        }
    }
}
 
Example 2
Source File: BaseFragment.java    From crystal-preloaders with Apache License 2.0 6 votes vote down vote up
@Override
public final View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

    if (rootView != null) {
        ViewGroup parent = (ViewGroup) rootView.getParent();
        if (parent != null)
            parent.removeView(rootView);
    }

    try {
        rootView = inflater.inflate(getLayout(), container, false);
    } catch (InflateException e) {
        e.printStackTrace();
    }

    return rootView;
}
 
Example 3
Source File: WebActivity.java    From BmapLite with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    try {
        initView(R.layout.activity_web);
        getData();
    } catch (InflateException e) {
        e.printStackTrace();
        onMessage("抱歉,不支持您的手机,未找到WebView或者WebView版本过低");
    }
}
 
Example 4
Source File: WebActivity.java    From BmapLite with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    try {
        initView(R.layout.activity_web);
        getData();
    } catch (InflateException e) {
        e.printStackTrace();
        onMessage("抱歉,不支持您的手机,未找到WebView或者WebView版本过低");
    }
}
 
Example 5
Source File: CaptionFragment.java    From android-viewer-for-khan-academy with GNU General Public License v3.0 5 votes vote down vote up
@Override
public View getView(int position, View convertView, ViewGroup parent) {
	if (convertView == null) {
		try {
			convertView = inflater.inflate( R.layout.list_item_caption, parent, false);
		} catch (InflateException e) {
			e.printStackTrace();
			return null;
		}
	}
	TextView time = (TextView) convertView.findViewById(R.id.caption_time);
	TextView text = (TextView) convertView.findViewById(R.id.caption_text);
	
	if (time == null || text == null) {
		// Have seen some inexplicable NPEs somewhere in this method (line
		// number reads 368, which was the last line of this file.)
		return convertView;
	}
	
	Caption caption = getItem(position);
	if (caption != null) {
		time.setText(caption.getTime_string());
		text.setText(caption.getText());
	} else {
		time.setText("");
		text.setText("");
	}
	
	return convertView;
}