mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-26 09:43:15 +00:00
Contextの取得方法を修正
This commit is contained in:
parent
d4e429fdca
commit
1fa625e948
|
@ -16,13 +16,15 @@ import dagger.hilt.android.qualifiers.ApplicationContext;
|
|||
|
||||
import one.nem.lacerta.source.pref.repository.Common;
|
||||
|
||||
@AndroidEntryPoint
|
||||
public class CommonImpl implements Common {
|
||||
|
||||
@ApplicationContext
|
||||
@Inject
|
||||
Context applicationContext;
|
||||
|
||||
@Inject
|
||||
public CommonImpl(@ApplicationContext Context applicationContext) {
|
||||
this.applicationContext = applicationContext;
|
||||
}
|
||||
|
||||
public String getStringValue(String key) {
|
||||
SharedPreferences pref = applicationContext.getSharedPreferences("common", Context.MODE_PRIVATE);
|
||||
return pref.getString(key, "");
|
||||
|
|
Loading…
Reference in New Issue
Block a user