Back to project page RoboBinding-gallery.
The source code is released under:
Apache License
If you think the Android project RoboBinding-gallery 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 org.robobinding.gallery.activity; //from w ww . j a v a 2 s . com import org.robobinding.MenuBinder; import org.robobinding.ViewBinder; import org.robobinding.binder.BinderFactory; import org.robobinding.gallery.model.typedcursor.DatabaseHelper; import android.support.v7.app.ActionBarActivity; import android.view.Menu; import android.view.MenuInflater; import android.view.View; /** * * @since 1.0 * @version $Revision: 1.0 $ * @author Cheng Wei */ public abstract class AbstractActivity extends ActionBarActivity { public void initializeContentView(int layoutId, Object presentationModel) { ViewBinder viewBinder = createViewBinder(); View rootView = viewBinder.inflateAndBind(layoutId, presentationModel); setContentView(rootView); } private ViewBinder createViewBinder() { BinderFactory binderFactory = getReusableBinderFactory(); return binderFactory.createViewBinder(this); } private BinderFactory getReusableBinderFactory() { BinderFactory binderFactory = getGalleryApp().getReusableBinderFactory(); return binderFactory; } private GalleryApp getGalleryApp() { return (GalleryApp)getApplicationContext(); } protected DatabaseHelper getDatabaseHelper() { return getGalleryApp().getDatabaseHelper(); } protected MenuBinder createMenuBinder(Menu menu, MenuInflater menuInflater) { BinderFactory binderFactory = getReusableBinderFactory(); return binderFactory.createMenuBinder(menu, menuInflater, this); } }