I have do with "Library projects" to config!but onClick is not available on my library for "aar":
the logcat without printing
@OnClick({R2.id.m_button_pattern, R2.id.m_button_password})
public void onClick(View view) {
Log.d("xx", "========onClick=========");
Intent intent = new Intent();
switch (view.getId()) {
case R2.id.m_button_pattern:
intent.setClass(getApplicationContext(),MainActivity.class);
Log.d("xx", "========onClick====MainActivity=====");
break;
case R2.id.m_button_password:
intent.setClass(getApplicationContext(),SetPasswordLockActivity.class);
Log.d("xx", "========onClick=====SetPasswordLockActivity====");
break;
}
this.startActivity(intent);
}
You should use normal R.id. references in the runtime code (aka your method). This means you cannot use a switch, so use if/else instead.
@JakeWharton Thanks
Most helpful comment
You should use normal
R.id.references in the runtime code (aka your method). This means you cannot use a switch, so use if/else instead.