惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

美团技术团队
B
Blog RSS Feed
博客园_首页
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Google DeepMind News
Google DeepMind News
D
Docker
Blog — PlanetScale
Blog — PlanetScale
M
MIT News - Artificial intelligence
C
Check Point Blog
The Cloudflare Blog
T
Tailwind CSS Blog
大猫的无限游戏
大猫的无限游戏
量子位
The GitHub Blog
The GitHub Blog
Microsoft Azure Blog
Microsoft Azure Blog
I
InfoQ
T
The Blog of Author Tim Ferriss
博客园 - 【当耐特】
Vercel News
Vercel News
P
Proofpoint News Feed
Hugging Face - Blog
Hugging Face - Blog
V
V2EX
博客园 - 司徒正美

Kotlin

compose 使用性能问题 有人在项目里面使用 compose 开发吗 大家会在老项目中使用 kotlin 吗 Kotlin 中文文档 2.2.20 版翻译完成了 Kotlin 中文文档 2.1.20 版翻译完成了 Kotlin 中文文档 2.1.0 版翻译完成了 Kotlin 中文文档 2.0.20 版翻译完成了 MIUI API28+ActivityTransition API+kotlin 无法检测到活动,只能手动触发广播,怎么定位问题? 我老人家翻译的 Kotlin 中文文档,正在更新到最新的 2.0.20 版 我老人家翻译的《Kotlin 语言参考文档》中文版,已经迁移到了新的 Writerside 环境 kotlin 没有受检异常真太难顶了。吐槽 屎山代码一则 Kotlin 2.0.0 正式版发布了 kotlin 中的 select 到底可以 select 哪些内容啊? 请大佬帮忙看一眼我这个注解为什么没能抑制 never used 警告? 我老人家翻译的《Kotlin 语言参考文档》中文版 使用 compose 开发了讯飞星火认知模型桌面端应用 Kotlin 的协程到底是用来干嘛的?为什么没有可 suspend 的异步 IO 函数? Kotlin 协程 Coroutine 与 Spring Boot 项目整合的最佳实践是怎样的? 谷歌出品 kotlin 入门教程 kotlin 源代码数据集 KMM 中目前最成熟,最推荐的 shared viewmodel 方案是什么. ​ Java /kotlin AST 构建相关,悬赏 200 求解,人已经麻了 有没有 Kotlin 讲协程比较好的书籍或博客连载 ArrayList.set 提示 第二个参数 element 类型是 NoThing ? 哪些公司后端用 kotlin 写的 kotlin 表达式引擎 最近在看 Kotlin 别人一些代码, 看到如下的代码惊呆了 Kotlin 的协程是真协程吗?被 b 站博主搞蒙了 怎么解决 public reified 函数会要求所有用到的依赖都是 public 的问题
有没有人能帮我解释一下,这里面的代码.如果我创建一个新窗口,...
sucvia · 2022-01-12 · via Kotlin

package com.example.myapplication2

import android.os.Bundle import com.google.android.material.snackbar.Snackbar import androidx.appcompat.app.AppCompatActivity import androidx.navigation.findNavController import androidx.navigation.ui.AppBarConfiguration import androidx.navigation.ui.navigateUp import androidx.navigation.ui.setupActionBarWithNavController import android.view.Menu import android.view.MenuItem import com.example.myapplication2.databinding.ActivityMainBinding

class MainActivity : AppCompatActivity() {

private lateinit var appBarConfiguration: AppBarConfiguration //创建 2 个变量
private lateinit var binding: ActivityMainBinding

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)

    binding = ActivityMainBinding.inflate(layoutInflater)
    setContentView(binding.root)

    setSupportActionBar(binding.toolbar)

    val navController = findNavController(R.id.nav_host_fragment_content_main)
    appBarConfiguration = AppBarConfiguration(navController.graph)
    setupActionBarWithNavController(navController, appBarConfiguration)

    binding.fab.setOnClickListener { view ->
        Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
            .setAction("Action", null).show()
    }
}

override fun onCreateOptionsMenu(menu: Menu): Boolean {
    // Inflate the menu; this adds items to the action bar if it is present.
    menuInflater.inflate(R.menu.menu_main, menu)
    return true
}

override fun onOptionsItemSelected(item: MenuItem): Boolean {
    return when (item.itemId) {
        R.id.action_settings -> true
        else -> super.onOptionsItemSelected(item)
    }
}

override fun onSupportNavigateUp(): Boolean {
    val navController = findNavController(R.id.nav_host_fragment_content_main)
    return navController.navigateUp(appBarConfiguration)
            || super.onSupportNavigateUp()
}

}

我是个萌新,刚学 Kotlin,有没有推荐群一起学习?

按照以上代码,如果我有个按钮 id="create_button" ,按下载入 test_window.xml 窗口. test_window.xml 里面有什么讲究吗?