Skip to content

Commit 0435c1c

Browse files
committed
constructor injected Gson to this file
1 parent 7011d21 commit 0435c1c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

raveandroid/src/main/java/com/flutterwave/raveandroid/data/SharedPrefsRequestImpl.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@ public class SharedPrefsRequestImpl implements DataRequest.SharedPrefsRequest {
2626
SharedPreferences sharedPreferences;
2727
SharedPreferences.Editor editor;
2828
String FLW_REF_KEY = "flw_ref_key";
29+
Gson gson;
2930

3031
@Inject
31-
public SharedPrefsRequestImpl(Context context) {
32+
public SharedPrefsRequestImpl(Context context, Gson gson) {
3233
this.context = context;
34+
this.gson = gson;
3335
}
3436

3537
@Override
@@ -63,7 +65,6 @@ public void saveACard(SavedCard card, String SECKEY, String email) {
6365
savedCards.add(card);
6466

6567
init();
66-
Gson gson = new Gson();
6768
Type type = new TypeToken<List<SavedCard>>() {}.getType();
6869
String json = gson.toJson(savedCards, type);
6970

0 commit comments

Comments
 (0)