Crash by Intent StartActivity

Put your problem here if it does not fit any of the other categories.

Crash by Intent StartActivity

Postby gertcarpenter » Tue Nov 09, 2010 2:30 pm

My application crashes when i want to open a new activity with a intent. I have tried everything, check the log, check the internet but i cant find a solution. Now i have made the onclick function as simple as possible, but the probleem keep exist.

This is my code:
Code: Select all
private Button.OnClickListener zoekButtonClicked = new Button.OnClickListener(){
     @Override
          public void onClick(View v){      
               Intent i = new Intent(BanenHome.this, BanenVacatures.class);
               BanenHome.this.startActivity(i);
     }
};


In the onCreate function i have initialized the button onclick:

Code: Select all
this.zoekButton = (Button)this.findViewById(R.id.btnZoeken);
zoekButton.setOnClickListener(zoekButtonClicked);


This is the Error Stack:
Code: Select all
Thread [<3> main] (Suspended (exception RuntimeException))   
   ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2496   
   ActivityThread.handleLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2512   
   ActivityThread.access$2200(ActivityThread, ActivityThread$ActivityRecord, Intent) line: 119   
   ActivityThread$H.handleMessage(Message) line: 1863   
   ActivityThread$H(Handler).dispatchMessage(Message) line: 99   
   Looper.loop() line: 123   
   ActivityThread.main(String[]) line: 4363   
   Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]   
   Method.invoke(Object, Object...) line: 521   
   ZygoteInit$MethodAndArgsCaller.run() line: 860   
   ZygoteInit.main(String[]) line: 618   
   NativeStart.main(String[]) line: not available [native method]   
gertcarpenter
Freshman
Freshman
 
Posts: 2
Joined: Tue Nov 09, 2010 2:12 pm

Top

Re: Crash by Intent StartActivity

Postby urbantrad » Tue Nov 09, 2010 3:39 pm

What exactly is the message that the exeption tells you?
urbantrad
Senior Developer
Senior Developer
 
Posts: 104
Joined: Thu Sep 09, 2010 10:19 pm

Re: Crash by Intent StartActivity

Postby gertcarpenter » Tue Nov 09, 2010 3:51 pm

it's in dutch, but the translation is such as "the application <<name>> (process: com.nvb.banen_nl) is stopped unexpected. Try Again.
gertcarpenter
Freshman
Freshman
 
Posts: 2
Joined: Tue Nov 09, 2010 2:12 pm

Re: Crash by Intent StartActivity

Postby urbantrad » Tue Nov 09, 2010 6:19 pm

If you check your logcat, it should tell a more detailed exception message, explaining the reason why it is crashing. And don't worry, i'm belgian so i'd understand anyway :P
urbantrad
Senior Developer
Senior Developer
 
Posts: 104
Joined: Thu Sep 09, 2010 10:19 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 10 guests