Skip to content

Instantly share code, notes, and snippets.

@aratakokubun
Created August 29, 2015 05:15
Show Gist options
  • Save aratakokubun/f6c46b04bd00a751afa6 to your computer and use it in GitHub Desktop.
Save aratakokubun/f6c46b04bd00a751afa6 to your computer and use it in GitHub Desktop.
Android AnnotationでNullPointerException ref: http://qiita.com/aratakokubun/items/fde977b4ef12b05a188e
@EActivity(R.layout.test)
public class Test extends Activity {
@ViewById(R.id.mySurfaceView)
TestSurfaceView tsv;
@Click(R.id.leftButton)
protected void leftButtonClick(final View view) {
// TODO
}
@EActivity(R.layout.test)
public class Test extends Activity {
@ViewById(R.id.mySurfaceView)
TestSurfaceView tsv;
protected void onCreate(BundlesavedInstanceState) {
    super.onCreate(savedInstanceState);
    // 試しにメソッド呼びだし
    tsv.doSomething();
}
}
@EActivity(R.layout.test)
public class Test extends Activity {
@ViewById(R.id.mySurfaceView)
TestSurfaceView tsv;
protected void onCreate(BundlesavedInstanceState) {
    super.onCreate(savedInstanceState);
}
@AfterViews
void initialize(){
// Wait for surfaceview ready
    // 試しにメソッド呼びだし
    tsv.doSomething();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment