Back to project page InfuseFactory.
The source code is released under:
/** * Copyright (c) 2014 Lazu Ioan-Bogdan * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from ...
If you think the Android project InfuseFactory listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.factory.infuse.internal; // w w w. j av a2 s . c o m import android.app.Activity; import android.support.v4.app.Fragment; import android.view.View; public class ViewResolver { private Activity mActivity; private Fragment mFragment; private View mView; public ViewResolver(Activity activity) { mActivity = activity; } public ViewResolver(Fragment fragment) { mFragment = fragment; } public ViewResolver(View view) { mView = view; } public View resolveView(int id) { if(mActivity != null) { return mActivity.findViewById(id); } else if(mFragment != null) { return mFragment.getView().findViewById(id); } else { return mView.findViewById(id); } } }