-
Notifications
You must be signed in to change notification settings - Fork 1
Use Cases
edolganov edited this page May 1, 2013
·
10 revisions
- Setup
static {
LogFactory.setTagPrefix("SOME-TAG");
}- Use
Logger log = LogFactory.getLog(getClass());
log.info("some info msg");
log.error("ups error", e);No need of super calls anymore:
import easydroid.core.BaseActivity;
public class YourActivity extends BaseActivity {
@Override
protected void onCreateSafe(Bundle bundle) {
//no need of super.onCreate(bundle)
}
@Override
protected void onDestroySafe() {
//no need of super.onDestroy()
}
}Use @InjectView annotation:
import easydroid.core.BaseActivity;
public class YourActivity extends BaseActivity {
@InjectView(R.id.browser_back)
View backButton;
@InjectView(R.id.browser_home)
View homeButton;
@Override
protected void onCreateSafe(Bundle savedInstanceState) {
setContentView(R.layout.browser);
//access to backButton and homeButton
}
}Use @ContentView instead of setContentView function:
import easydroid.core.BaseActivity;
@ContentView(R.layout.browser)
public class YourActivity extends BaseActivity {
@InjectView(R.id.browser_back)
View backButton;
@InjectView(R.id.browser_home)
View homeButton;
@Override
protected void onCreateSafe(Bundle savedInstanceState) {
//access to backButton and homeButton
}
}