Android Open Source - RoboBinding-album-sample Abstract Activity

From Project

Back to project page RoboBinding-album-sample.


The source code is released under:

Apache License

If you think the Android project RoboBinding-album-sample listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package org.robobinding.albumsample.activity;
//from ww w .jav  a2s  . c o  m
import org.robobinding.ViewBinder;
import org.robobinding.binder.BinderFactory;

import android.view.View;

 * @author Cheng Wei
 * @version $Revision: 1.0 $
 * @since 1.0
public abstract class AbstractActivity extends Activity {
    public void initializeContentView(int layoutId, Object presentationModel) {
        ViewBinder viewBinder = createViewBinder(true);
        View rootView = viewBinder.inflateAndBind(layoutId, presentationModel);

    protected ViewBinder createViewBinder(boolean withPreInitializingViews) {
        BinderFactory binderFactory = getAlbumApp().getReusableBinderFactory();
        return binderFactory.createViewBinder(this, withPreInitializingViews);

    private AlbumApp getAlbumApp() {
        return (AlbumApp) getApplicationContext();

    public AlbumStore getAlbumStore() {
        return getAlbumApp().getAlbumStore();

Java Source Code List