代码语言:javascript 复制 val intent=Intent(this@MainActivity,NewWordActivity::class.java)// startActivityForResult(intent, newWordActivityRequestCode)startActivity.launch(intent) 再看下Java版本的写法完整版: 代码语言:javascript 复制 /** * @author xiayiye5 * @date 2021/9/23 13:52 */publicclassJu...
最初大多數人會用擴充函式進行封裝,而在activity-ktx:1.2.0-beta02版本之後,呼叫註冊方法的時機必須在onStart()之前,原來的擴充函式就不適用了,在這之後就沒看到有人進行封裝了。 個人對 Activity Result API 的封裝思考了很久,已經儘量做到在 Kotlin 和 Java 都足夠地好用,可以完美替代startActivityForResult()...
java代码用法 ActivityLauncherKt.launchActivityForResult(activity, intent, result -> {if(result.getResultCode() == Activity.RESULT_OK) { Intent data = result.getData();//do something}else{//...} }); 简介 替代startActivityForResult,简化registerForActivityResult使用 ...
Support for the usage of Kotlin and Java Support for the usage of coroutine Support for taking picture (Adapted to Android 10) Support for taking video (Adapted to Android 10) Support for selecting pictures or videos Support for cropping pictures (Adapted to Android11) Support for requesting per...
Support for the usage of Kotlin and Java Support for the usage of coroutine Support for taking picture (Adapted to Android 10) Support for taking video (Adapted to Android 10) Support for selecting pictures or videos Support for cropping pictures (Adapted to Android11) ...