• Andorid之Annotation框架初使用(七)


    Save Instance State:
    程序保留Activity的实例状态 , 在onSaveInstanceState(Bundle)被系统调用的时候自动保存 , onCreate(Bundle)被系统调用会重新修复。

    @EActivity
    public class MyActivity extends Activity {
        @InstanceState
        int someId;
        @InstanceState
        MySerializableBean bean;
    }


    设置没有Title:

    @NoTitle
    public class MyActivity extends Activity {}


    设置全屏:

    @Fullscreen
    public class MyActivity extends Activity {}


    设置自定义的Title:

    @CustomTitle(R.layout.custom_title)
    public class MyActivity extends Activity {}


    OnActivityResult:

    @OnActivityResult(REQUEST_CODE)
     void onResult(int resultCode, Intent data) {
     }
     @OnActivityResult(REQUEST_CODE)
     void onResult(int resultCode) {
     }
     @OnActivityResult(ANOTHER_REQUEST_CODE)
     void onResult(Intent data) {
     }
     @OnActivityResult(ANOTHER_REQUEST_CODE)
     void onResult() {
     }


    Ormlite :
    @OrmLiteDao( help= android.database.sqlite.SQLiteOpenHelper类的实例 , model= 模型类 )

    @EActivity
    public class MyActivity extends Activity {
        // UserDao is a Dao<User, Long>
        @OrmLiteDao(helper = DatabaseHelper.class, model = User.class)
        UserDao userDao;
        @OrmLiteDao(helper = DatabaseHelper.class, model = Car.class)
        Dao<Car, Long> carDao;
    }
  • 相关阅读:
    02-print的用法
    01-Hello World
    01-查看系统整体性能情况:sar
    03-购物车
    Python之路,Day2
    02-三级菜单
    Python之路,Day1
    loadrunner中配置java脚本环境
    算法
    实现testNg的retry机制
  • 原文地址:https://www.cnblogs.com/lee0oo0/p/3150230.html
Copyright © 2020-2023  润新知