Skip to content

Commit

Permalink
clear context for EasyAdsMod
Browse files Browse the repository at this point in the history
  • Loading branch information
nisrulz committed Jan 8, 2020
1 parent 73d7ee8 commit 2a86e1a
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,17 @@ public class MainActivity extends AppCompatActivity {

ArrayAdapter<String> adapter = null;

private EasyAdsMod easyAdsMod = null;

@SuppressLint("MissingPermission")
@TargetApi(VERSION_CODES.LOLLIPOP_MR1)
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.setContentView(R.layout.activity_main);

easyAdsMod = new EasyAdsMod(getApplicationContext());

//Data Array List of Info Object
final ArrayList<String> data = new ArrayList<>();

Expand Down Expand Up @@ -101,7 +105,7 @@ protected void onCreate(final Bundle savedInstanceState) {
emailString.append('-');
}

final EasyAdsMod easyAdsMod = new EasyAdsMod(this);

easyAdsMod.getAndroidAdId(new AdIdentifierCallback() {
@Override
public void onSuccess(final String adIdentifier, final boolean adDonotTrack) {
Expand Down Expand Up @@ -181,7 +185,7 @@ public void onSuccess(final String adIdentifier, final boolean adDonotTrack) {

if (easySimMod.isMultiSim()) {
final List<SubscriptionInfo> activeMultiSimInfo = easySimMod.getActiveMultiSimInfo();
if (activeMultiSimInfo != null) {
if (activeMultiSimInfo.size() > 0) {
final StringBuilder stringBuilder = new StringBuilder();
for (int i = 0; i < activeMultiSimInfo.size(); i++) {
stringBuilder.append("\nSIM ")
Expand Down Expand Up @@ -452,4 +456,10 @@ public void onBackPressed() {
super.onBackPressed();
this.finish();
}

@Override
protected void onDestroy() {
easyAdsMod.clear();
super.onDestroy();
}
}

0 comments on commit 2a86e1a

Please sign in to comment.