package com.kantor.sam.borderwaittimes;

import android.os.AsyncTask;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;
import android.widget.Toast;

import com.kantor.sam.borderwaittimes.Parser;

public class MainActivity extends AppCompatActivity {

    @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);
    }
    public void update (View v) throws Exception
    {
        Parser ps = new Parser();
        ps.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
        //Toast toast = Toast.makeText(getApplicationContext(), ps.Bridge1_time, Toast.LENGTH_LONG); // testing

        TextView textView = (TextView)findViewById(R.id.textView1);
        TextView textView2 = (TextView)findViewById(R.id.textView2);
        TextView textView3 = (TextView)findViewById(R.id.textView3);
        textView.setText(ps.Bridge1_time);
        textView2.setText(ps.Bridge2_time);
        textView3.setText(ps.Bridge3_time);
        invalidateOptionsMenu();

        Toast toast = Toast.makeText(getApplicationContext(), "Updating", Toast.LENGTH_SHORT);
    }

}

@@ -34,16 +34,45 @@
 times;%0A%0A
+import android.app.Activity;%0A
 import a
@@ -1545,19 +1545,23 @@
  Parser(
+this
 );%0A
-
         
@@ -1729,481 +1729,13 @@
 ting
-%0A%0A        TextView textView = (TextView)findViewById(R.id.textView1);%0A        TextView textView2 = (TextView)findViewById(R.id.textView2);%0A        TextView textView3 = (TextView)findViewById(R.id.textView3);%0A        textView.setText(ps.Bridge1_time);%0A        textView2.setText(ps.Bridge2_time);%0A        textView3.setText(ps.Bridge3_time);%0A        invalidateOptionsMenu();%0A%0A        Toast toast = Toast.makeText(getApplicationContext(), %22Updating%22, Toast.LENGTH_SHORT);
 %0A    %7D%0A
-%0A
 %7D%0A

Initialize Parser Class with an Activity Object so that AsyncTask can find TextView's.