Instantly share code, notes, and snippets.

Embed
What would you like to do?
package eu.f3rog.ui.activity;
import android.os.Bundle;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import butterknife.Bind;
import butterknife.ButterKnife;
import eu.f3rog.mangafreak.R;
/**
* Class {@link BaseActivity}
*
* @author FrantisekGazo
* @version 2016-03-11
*/
public abstract class BaseActivity
extends AppCompatActivity {
@Nullable
@Bind(R.id.toolbar)
Toolbar mToolbar;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(getLayout());
ButterKnife.bind(this);
if (mToolbar != null) {
setSupportActionBar(mToolbar);
}
}
@LayoutRes
protected abstract int getLayout();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment