android - 如何理解类型 "Context"?

标签 android sqlite android-context

private static class OpenHelper extends SQLiteOpenHelper {
    OpenHelper(Context context) {
    super(context, DATABASE_NAME, null, DATABASE_VERSION);
}}

我无法理解 Context 类型的含义。看了说明书还是看不懂。

最佳答案

上下文是一个接口(interface)!

根据源码:

Interface to global information about an application environment. This is an abstract class >whose implementation is provided by the Android system. It allows access to application-specific resources and classes, as well as up-calls for application-level operations such as launching activities, broadcasting and receiving intents, etc.

参见 http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.0.4_r1.2/android/content/Context.java#Context为了最好的理解

关于android - 如何理解类型 "Context"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11880177/

相关文章:

android - Flutter 添加flutter_email_sender 插件后编译不通过

具有自定义背景的 Android float 操作按钮

java - sqlite 表创建

python - 找不到符号 : _sqlite3_enable_load_extension - sqlite installed via homebrew

java - Activity 内的 Android 上下文可以是静态的吗?

java - getApplicationContext() 与 AppWidgetProvider

android - 无法检索共享的首选项数据

android - 如何告诉 Android 不要缩放图像?

Django sqlite3-manage.pysyncdb时出现错误

java - 安卓 : Scheduling a database call in future