プロバイダ作成

This commit is contained in:
r-ca 2023-12-14 03:32:02 +09:00
parent b463b61fd4
commit 08fafcfced
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9

View File

@ -1,8 +1,13 @@
package one.nem.lacerta.source.database;
import android.content.Context;
import androidx.room.Room;
import dagger.Module;
import dagger.Provides;
import dagger.hilt.InstallIn;
import dagger.hilt.android.qualifiers.ApplicationContext;
import dagger.hilt.components.SingletonComponent;
@Module
@ -10,7 +15,9 @@ import dagger.hilt.components.SingletonComponent;
public class LacertaDatabaseModule {
@Provides
public LacertaDatabase provideLacertaDatabase() {
return null;
public LacertaDatabase provideLacertaDatabase(@ApplicationContext Context context) {
return Room.databaseBuilder(context,
LacertaDatabase.class,
"lacerta.db").build();
}
}