mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-23 00:13:16 +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;
|
import one.nem.lacerta.source.pref.repository.Common;
|
||||||
|
|
||||||
@AndroidEntryPoint
|
|
||||||
public class CommonImpl implements Common {
|
public class CommonImpl implements Common {
|
||||||
|
|
||||||
@ApplicationContext
|
|
||||||
@Inject
|
|
||||||
Context applicationContext;
|
Context applicationContext;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
public CommonImpl(@ApplicationContext Context applicationContext) {
|
||||||
|
this.applicationContext = applicationContext;
|
||||||
|
}
|
||||||
|
|
||||||
public String getStringValue(String key) {
|
public String getStringValue(String key) {
|
||||||
SharedPreferences pref = applicationContext.getSharedPreferences("common", Context.MODE_PRIVATE);
|
SharedPreferences pref = applicationContext.getSharedPreferences("common", Context.MODE_PRIVATE);
|
||||||
return pref.getString(key, "");
|
return pref.getString(key, "");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user