0

My application was working good but all on a sudden it stopped even launching. here is the logcat

04-02 17:11:00.234: E/Trace(732): error opening trace file: No such file or directory (2)
04-02 17:11:02.005: D/AndroidRuntime(732): Shutting down VM
04-02 17:11:02.005: W/dalvikvm(732): threadid=1: thread exiting with uncaught exception (group=0x40a13300)
04-02 17:11:02.024: E/AndroidRuntime(732): FATAL EXCEPTION: main
04-02 17:11:02.024: E/AndroidRuntime(732): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.tracker/com.example.tracker.MainActivity}: java.lang.NullPointerException
04-02 17:11:02.024: E/AndroidRuntime(732):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
04-02 17:11:02.024: E/AndroidRuntime(732):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
04-02 17:11:02.024: E/AndroidRuntime(732):  at android.app.ActivityThread.access$600(ActivityThread.java:130)
04-02 17:11:02.024: E/AndroidRuntime(732):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
04-02 17:11:02.024: E/AndroidRuntime(732):  at android.os.Handler.dispatchMessage(Handler.java:99)

and my main java

package com.example.tracker;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Button inbus=(Button) findViewById(R.id.button1);
        Button inbay=(Button) findViewById(R.id.button2);

        inbus.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View arg0) {
                // TODO Auto-generated method stub
                startActivity(new Intent(MainActivity.this,Inbus.class));
                        }
        });

        inbay.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub
            startActivity(new Intent(MainActivity.this, Inbay.class));  
            }
        });
    }

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

}
InnocentKiller
  • 5,234
  • 7
  • 36
  • 84
joss
  • 695
  • 1
  • 5
  • 16
  • possible duplicate of [error opening trace file: No such file or directory (2)](http://stackoverflow.com/questions/11446049/error-opening-trace-file-no-such-file-or-directory-2) – Hariharan Apr 02 '14 at 12:04
  • I have tried all the possibilities in the above link, but its not working – joss Apr 02 '14 at 12:11
  • Please change your title to reflect the null pointer exception and add the rest of the stack trace. The traces file message is meaningless as it does not point to the cause but rather a configuration problem in the crash reporter - so you do not want to be grouped with the questions that saw that for a plethora of distinct reasons. – Chris Stratton Apr 02 '14 at 12:49

0 Answers0