Created
July 18, 2015 03:25
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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