Skip to content

Commit

Permalink
Edit example app
Browse files Browse the repository at this point in the history
  • Loading branch information
nonelse committed Apr 29, 2016
1 parent 294348a commit 9e9f2d2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ public void onCreate() {
// change the log level
config.setLogLevel(LogLevel.VERBOSE);

// enable event buffering
//config.setEventBufferingEnabled(true);

// set default tracker
//config.setDefaultTracker("{YourDefaultTracker}");

Expand Down Expand Up @@ -97,6 +94,12 @@ public boolean launchReceivedDeeplink(Uri deeplink) {
}
});

// allow to send in the background
config.setSendInBackground(true);

// enable event buffering
//config.setEventBufferingEnabled(true);

Adjust.onCreate(config);

// register onResume and onPause events of all activities
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
package com.adjust.example;

import android.content.Intent;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.SystemClock;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;

import com.adjust.sdk.Adjust;

public class ServiceActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_service);

Intent intent = getIntent();
Uri data = intent.getData();
Adjust.appWillOpenUrl(data);
}

public void onServiceClick(View v) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
public class ServiceExample extends Service {
private static final String EVENT_TOKEN_BACKGROUND = "{YourEventToken}";

private static boolean flip = true;

public ServiceExample() {
super();
Log.d("example", "ServiceExample constructor");
Expand All @@ -39,6 +41,14 @@ public int onStartCommand(Intent intent, int flags, int startId) {
int startDefaultOption = super.onStartCommand(intent, flags, startId);
Log.d("example", "ServiceExample onStartCommand");

if (flip) {
Adjust.setEnabled(false);
flip = false;
} else {
Adjust.setEnabled(true);
flip = true;
}

new AsyncTask<Void,Void,Void>() {
@Override
protected Void doInBackground(Void... params) {
Expand Down

0 comments on commit 9e9f2d2

Please sign in to comment.