Immediate App Crash, whenever single line of code is added
<p>Here is a class that works perfectly until I wanted to add one more feature, The code compiles then crashes immediately upon execution. <br>The problem lies with the <code>componentAnalyzer</code> class that I wish to implement in this class. I don´t know why it won't work because I implemented this <code>componentAnalyzer</code> in another class in the exact same way and it works beautifully. </p>

<p>I think its a small mistake but unsure. I commented out the part that was creating problems because the rest works and should not be touched. </p>

<p>The method that will use the <code>componentAnalyzer</code> is at the end of the code. I cut out everything that was working in order to see it easier.</p>

<pre><code>public class PowerMonitorActivity extends Activity implements SeekBar.OnSeekBarChangeListener {
    private static boolean instantiated = false;

    //private static ComponentAnalyzer componentAnalyzer;
    //private Context context;

    private Button changeGPSButton;
    private Button changeAudioButton;       
    private Button locationUpdateButton;        
    private SeekBar brightnessSeekBar;
    private int screenBrightness = 123;         
    private Handler cpuHandler = new Handler();
    private CPUMonitor cpuMonitor = new CPUMonitor();
    private int updateTime = 1000;

    private Handler totalPowerHandler = new Handler ();         
    private MediaManager mediaManager = new MediaManager();
    private boolean requestingLocation = false;

    private boolean wifiIsTransmitting = false;
    private boolean wifiIsConnected = false;
    private boolean cellIsTransmitting = false;
    private boolean cellIsConnected = false;
    private boolean isLogging = false;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        //Bundle extras = getIntent().getExtras();
        if (!instantiated) {
            instantiated = true;
                 //componentAnalyzer = new ComponentAnalyzer(context, extras);
        }

        // Create GPS button - note that location settings cannot be changed directly
        // in a program. Rather, a settings screen is shown when this button is pressed.
        changeGPSButton = (Button)findViewById(R.id.changeGPS);
        changeGPSButton.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                showGPSOptions();
            }
        });

        totalPowerHandler.removeCallbacks(updatePower);
        totalPowerHandler.postDelayed(updatePower, 1000);  
    }

    private Runnable updateCpu = new Runnable() {
        public void run() {
            float util = cpuMonitor.getUtil();
            int rutil = Math.round(100*util);

            TextView cpuTextView = (TextView)findViewById(R.id.cpuTextView);
            cpuTextView.setText(rutil+"%");      
            cpuHandler.postDelayed(this, updateTime);
            }   
    };


    private Runnable updatePower = new Runnable() 
    {
        public void run()
        {
            //float testPower = componentAnalyzer.getWifiPower();; 

            TextView totalPowerView = (TextView)findViewById(R.id.totalPowerTextView);
            //totalPowerView.setText(testPower+"mW");

            totalPowerHandler.postDelayed(this, 1000);
        }
    };        
</code></pre>
