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

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
WordPress大学
WordPress大学
aimingoo的专栏
aimingoo的专栏
博客园 - 聂微东
M
MIT News - Artificial intelligence
Microsoft Security Blog
Microsoft Security Blog
云风的 BLOG
云风的 BLOG
Google DeepMind News
Google DeepMind News
Apple Machine Learning Research
Apple Machine Learning Research
H
Hackread – Cybersecurity News, Data Breaches, AI and More
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
O
OpenAI News
N
News and Events Feed by Topic
TaoSecurity Blog
TaoSecurity Blog
有赞技术团队
有赞技术团队
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
MyScale Blog
MyScale Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Hacker News: Ask HN
Hacker News: Ask HN
Help Net Security
Help Net Security
爱范儿
爱范儿
W
WeLiveSecurity
V2EX - 技术
V2EX - 技术
Forbes - Security
Forbes - Security
Hacker News - Newest:
Hacker News - Newest: "LLM"
SecWiki News
SecWiki News
A
About on SuperTechFans
Cloudbric
Cloudbric
N
Netflix TechBlog - Medium
博客园 - 司徒正美
S
Security @ Cisco Blogs
Martin Fowler
Martin Fowler
Schneier on Security
Schneier on Security
I
InfoQ
Engineering at Meta
Engineering at Meta
Google Online Security Blog
Google Online Security Blog
T
Troy Hunt's Blog
Latest news
Latest news
N
News and Events Feed by Topic
Security Archives - TechRepublic
Security Archives - TechRepublic
Spread Privacy
Spread Privacy
NISL@THU
NISL@THU
B
Blog
L
LINUX DO - 最新话题
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
V
V2EX
J
Java Code Geeks
N
News | PayPal Newsroom
T
Tor Project blog
The GitHub Blog
The GitHub Blog

Kotlin

compose 使用性能问题 - V2EX 有人在项目里面使用 compose 开发吗 - V2EX 大家会在老项目中使用 kotlin 吗 - V2EX Kotlin 中文文档 2.2.20 版翻译完成了 - V2EX Kotlin 中文文档 2.1.20 版翻译完成了 - V2EX Kotlin 中文文档 2.1.0 版翻译完成了 - V2EX Kotlin 中文文档 2.0.20 版翻译完成了 - V2EX MIUI API28+ActivityTransition API+kotlin 无法检测到活动,只能手动触发广播,怎么定位问题? - V2EX 我老人家翻译的 Kotlin 中文文档,正在更新到最新的 2.0.20 版 - V2EX 我老人家翻译的《Kotlin 语言参考文档》中文版,已经迁移到了新的 Writerside 环境 - V2EX kotlin 没有受检异常真太难顶了。吐槽 - V2EX 屎山代码一则 - V2EX Kotlin 2.0.0 正式版发布了 - V2EX kotlin 中的 select 到底可以 select 哪些内容啊? - V2EX 请大佬帮忙看一眼我这个注解为什么没能抑制 never used 警告? - V2EX 我老人家翻译的《Kotlin 语言参考文档》中文版 - V2EX 使用 compose 开发了讯飞星火认知模型桌面端应用 - V2EX Kotlin 的协程到底是用来干嘛的?为什么没有可 suspend 的异步 IO 函数? - V2EX Kotlin 协程 Coroutine 与 Spring Boot 项目整合的最佳实践是怎样的? - V2EX 谷歌出品 kotlin 入门教程 - V2EX kotlin 源代码数据集 - V2EX KMM 中目前最成熟,最推荐的 shared viewmodel 方案是什么. - V2EX ​ Java /kotlin AST 构建相关,悬赏 200 求解,人已经麻了 - V2EX 有没有 Kotlin 讲协程比较好的书籍或博客连载 - V2EX ArrayList.set 提示 第二个参数 element 类型是 NoThing ? - V2EX 哪些公司后端用 kotlin 写的 - V2EX kotlin 表达式引擎 - V2EX 最近在看 Kotlin 别人一些代码, 看到如下的代码惊呆了 - V2EX Kotlin 的协程是真协程吗?被 b 站博主搞蒙了 - V2EX 怎么解决 public reified 函数会要求所有用到的依赖都是 public 的问题 - V2EX Result 的方式处理异常用的多吗,我看了下好像和比较受好评的 rust result 用法差不多 - V2EX Kotlin 更换了新 logo:更加立体、更加清晰 - V2EX Kotlin 1.5.20 发布了~快来看看新特性 - V2EX 关于 kotlin 处理多个可空类型的变量的问题 - V2EX 求解这个 eval 函数返回值为什么是个 lambda?怎么才能拿到值? ​​​ - V2EX kotlin lazy 形式的 grouping and mapping 应该怎么写, sequence 里 grouping + aggregate 怎么比 Java stream 还复杂得多 - V2EX 强大的 v2ex,大家擅长 Kotlin, webview 交互的伙伴,来一波 - V2EX springboot kotlin 和 Java 混编, json 序列化用哪个比较好 - V2EX 有哪些知名 iOS 应用是纯 Kotlin 开发的? - V2EX [协程递归问题请教] - V2EX kotlin 打包问题 - V2EX 求推荐 kotlin 安卓开发教程 - V2EX Kotlin 1.4 Released - V2EX 请教一下 kotlin json 序列化及配合 data class 的正确姿势 - V2EX 各位公司项目后端有用 Kotlin + Spring 的吗, DB 层框架选用的什么? - V2EX 慌的一批, Kotlin 这么优雅的语言为什么不火呢 - V2EX Kotlin 如何检测所有 lateinit 的 field 是否初始化 - V2EX 初入 kotlin,源码找不见求教 - V2EX libcore.reflect.parameterizedtypeimpl cannot be cast to Java .lang.clas 这个错误 我真是莫名其妙 - V2EX
有没有人能帮我解释一下,这里面的代码.如果我创建一个新窗口,按照这个逻辑,怎么显示出来 - V2EX
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 里面有什么讲究吗?