Error in Eclipse says my Main.java is not in folder but it is not there

Hey guys thanks for answering I'm really new to Android programming(I started today) and when I try to build an app that has a splash background that pops up after 5 secs, it gives me all sorts of errors including some files not appearing as well as "Skipped 48 frames!" Ill post the errors here

07-16 21:29:23.119: E/Trace(641): error opening trace file: No such file or directory (2)
07-16 21:29:23.309: D/dalvikvm(641): GC_FOR_ALLOC freed 73K, 3% free 8051K/8259K, paused 44ms, total 46ms
07-16 21:29:23.309: I/dalvikvm-heap(641): Grow heap (frag case) to 8.497MB for 614416-byte allocation
07-16 21:29:23.390: D/dalvikvm(641): GC_CONCURRENT freed 1K, 3% free 8650K/8903K, paused 33ms+16ms, total 79ms
07-16 21:29:23.709: I/Choreographer(641): Skipped 42 frames!  The application may be doing too much work on its main thread.
07-16 21:29:23.770: D/gralloc_goldfish(641): Emulator without GPU emulation detected.
07-16 21:29:29.019: I/Choreographer(641): Skipped 48 frames!  The application may be doing too much work on its main thread.

here is the main.java

public class Main extends Activity {

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
Thread logoTimer = new Thread(){
    public void run(){
        try{
            sleep(5000);
            Intent menuIntent = new Intent("com.kamath.thebasics.MENU");
            startActivity(menuIntent);
        } catch (InterruptedException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        finally{
        finish();   
        }
    }

};
logoTimer.start();
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.activity_main, menu);
    return true;
}

}

and the menu.java

public class menu extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

@Override
protected void onPause() {
    // TODO Auto-generated method stub
    super.onPause();
}

@Override
protected void onResume() {
    // TODO Auto-generated method stub
    super.onResume();
}

}

Answers


Try this(inside the onCreate of your Main Activity):

Thread myThread = new Thread(){

        public void run(){

            try{
                sleep(5000);

            }catch(InterruptedException e){
                e.printStackTrace();

            }finally{
                Intent menuIntent = new Intent("com.kamath.thebasics.MENU");
                startActivity(menuIntent);

            }
        }
    };

    myThread.run();

Maybe that helps.


Need Your Help

ASP.NET MVC for developing widget based portals

asp.net-mvc widget portal

How suitable is ASP.NET MVC for developing anything like