基于流畅 API 和参数验证的 Android Intent 包装器。
git clone https://github.com/robertoestivill/intentbuilder.git
com.robertoestivill.intentbuilder
intentbuilder
0.1.2
dependencies {
compile 'com.robertoestivill.intentbuilder:intentbuilder:0.1.2'
}The main class of the library is intentbuilder.IntentBuilder.
// Explicit intent
Intent intent = new IntentBuilder()
.context(this)
.activity(MyActivity.class)
.extra("my_key", "my_value")
.build();
// Implicit intent
Intent intent = new IntentBuilder()
.action("my.app.MY_GREAT_ACTION")
.extra("bool_key", true)
.extra("int_key", 123)
.extra("char_key", 'A')
.flags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
.build();…暂无开放 Issues,或尚未同步最近议题。