Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私のAndroidアプリで:SQLiteOpenHelperのonCreateメソッドでContextにアクセスするにはどうすればよいですか?
拡張SQLiteOpenHelperし、独自のコンストラクターでフィールドに保存します。その後、onCreate()コンテキストにアクセスできます。
SQLiteOpenHelper
onCreate()
そのクラスを拡張し、コンテキストをコンストラクターに渡すことができます。コンストラクターはそれを変数内に格納します。その後、onCreate メソッド内からアクセスできます。