package com.adjust.example;

import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;

import com.adjust.sdk.Adjust;
import com.adjust.sdk.Event;


public class MainActivity extends ActionBarActivity {

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


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }

    @Override
    public void onResume() {
        super.onResume();
        Adjust.onResume();
    }

    @Override
    public void onPause() {
        super.onPause();
        Adjust.onPause();
    }

    public void onTrackSimpleEventClick(View v) {
        Event event = new Event("{appToken}");

        Adjust.trackEvent(event);
    }

    public void onTrackRevenueEventClick(View v) {
        Event event = new Event("{appToken}");

        // add revenue 1 cent of an euro
        event.setRevenue(0.01, "EUR");

        Adjust.trackEvent(event);
    }

    public void onTrackEventWithCallbackClick(View v) {
        Event event = new Event("{appToken}");

        // add callback parameters to this parameter
        event.addCallbackParameter("key", "value");

        Adjust.trackEvent(event);
    }

    public void onTrackEventWithPartnerClick(View v) {
        Event event = new Event("{appToken}");

        // add partner parameters to this parameter
        event.addPartnerParameter("foo", "bar");

        Adjust.trackEvent(event);
    }
}

@@ -1475,35 +1475,37 @@
 t = new Event(%22%7B
-app
+event
 Token%7D%22);%0A%0A     
@@ -1617,35 +1617,37 @@
 t = new Event(%22%7B
-app
+event
 Token%7D%22);%0A%0A     
@@ -1845,35 +1845,37 @@
 t = new Event(%22%7B
-app
+event
 Token%7D%22);%0A%0A     
@@ -2105,19 +2105,21 @@
 Event(%22%7B
-app
+event
 Token%7D%22)

Correct token name in event examples