package com.example.andy.myapplication;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import org.json.JSONException;
import org.json.JSONObject;

public class MainActivity extends AppCompatActivity {
    Button show;
    JSONObject jsonObject;
    singleTonExample singletonexample;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        show = findViewById(R.id.show);

        singletonexample = singleTonExample.getInstance();
        singletonexample.init(getApplicationContext());

        show.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                singletonexample.put("paper", 10.0);
                singletonexample.put("recharge", 10.0);
                singletonexample.put("other bills", 10.0);
                Toast.makeText(MainActivity.this,singletonexample.getHashMap(), Toast.LENGTH_LONG).show();
            }
        });

    }
}
