Start new activity problem

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

Start new activity problem

Postby Zeba Momin » Mon Dec 14, 2009 7:45 am

Hii...
I've been using the following function to start a new activity
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. public void startNewActivity(Class<?> classTo) {
  2.  
  3.           Intent mainIntent = new Intent(GUIEngine.this, classTo);
  4.  
  5.           GUIEngine.this.startActivity(mainIntent);
  6.  
  7.      }
Parsed in 0.030 seconds, using GeSHi 1.0.8.4


where "GUIEngine" is my the main activity of my application.

This works absolutely fine to start a new activity but once a new activity is started it starts again after sumtime!!!
Why is dis happening?
Can sumone plzz help me wid dis?
Thank you...
Zeba Momin
Developer
Developer
 
Posts: 49
Joined: Thu Sep 17, 2009 6:53 am

Top

Re: Start new activity problem

Postby SteffenL » Fri Dec 18, 2009 12:23 pm

Hello,

I am not sure why that could be happening from the code you showed us. I think the actual problem lies somewhere else.
You could try to put a breakpoint in that function and use the debugger. If it is called more often than it should, you may get a better clue where to look.
I have not worked much with the debugger so I am not sure if you can see the call stack.
Regards,
Steffen
SteffenL
Junior Developer
Junior Developer
 
Posts: 23
Joined: Wed Dec 16, 2009 9:52 am

Postby achie1266 » Fri Dec 18, 2009 6:53 pm

so its being called again after some time from some where else.
try to debug it using logcat
[ignore this if you already know how to]
open a terminal and type in adb logcat [I use Linux, but it should be almost the same on other OSes too]
you can Log messages whereever you want to check them.
achie
User avatar
achie1266
Master Developer
Master Developer
 
Posts: 223
Joined: Mon Nov 09, 2009 10:56 pm
Location: Denver

Postby Zeba Momin » Sat Dec 19, 2009 6:15 am

Thank you...SteffenL and Achie for replying..
I cud solve dis problem by debugging my application (I use eclipse on windows).
Thank you.. :)
Zeba Momin
Developer
Developer
 
Posts: 49
Joined: Thu Sep 17, 2009 6:53 am

Postby SteffenL » Sat Dec 19, 2009 9:59 am

Great :D
Regards,
Steffen
SteffenL
Junior Developer
Junior Developer
 
Posts: 23
Joined: Wed Dec 16, 2009 9:52 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot] and 28 guests