得到
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
<!---
|
||||
This is the API of version 1.2.0
|
||||
-->
|
||||
|
||||
You can use LocalContext.current to receive the context of your Android App inside a Compose Function
|
||||
|
||||
```kotlin
|
||||
@Composable
|
||||
fun AndroidContextComposeDemo() {
|
||||
val context = LocalContext.current
|
||||
Text(text = "Read this string from Context: "+context.getString(R.string.app_name))
|
||||
}
|
||||
```
|
||||
|
||||
## See also:
|
||||
* [Full Example Code]({{ site.samplefolder }}/other/AndroidContextComposeDemo.kt)
|
||||
Reference in New Issue
Block a user