Skip to content

Instantly share code, notes, and snippets.

@AKiniyalocts
Created July 18, 2015 03:25
Show Gist options
  • Save AKiniyalocts/e32b598ab8a345634742 to your computer and use it in GitHub Desktop.
Save AKiniyalocts/e32b598ab8a345634742 to your computer and use it in GitHub Desktop.
Quick abstract super class for Activities that use ButterKnife. Eliminate calling ButterKnife.bind(this) every activity.
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import butterknife.ButterKnife;
/**
* Created by anthony on 7/17/15.
*/
public abstract class ButterKnifeActivity extends AppCompatActivity {
public abstract int getContentView();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(getContentView());
ButterKnife.bind(this);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment