New to developing (internship) having some problems/ignorance related
I have started an internship and picked up a few books that I have been following to try and put a simple application together for the business. Unfortunately, I am relatively new to java and completely new to application development so I am looking for any kind of help.
The basic idea of the application is to be able to show users closed banks (rss feed), a overview of recent failures (rss feed) and send them to a form on a website.
So I layed out a splash screen, then the menu would have 3 buttons, 2 to rss feeds and one to the form on the website.
Everything was going well until I couldn't figure out how to get from the splash screen to the menu.
I don't know what you need to look at so here is the manifest, splash xml and splash java.
Anything would be helpful as it is clear I am completely new and lost. I have done tutorials in the book and am frankly desperate. Also signed up for the app generator stuff that just came out but havent heard anything and don't know if there's any real app generator that wouldn't run me 800$ to build something this simple.
Thanks
Siggi
Last edited by sigurros; July 22nd, 2010 at 10:17 AM.
Reason: wrap code
I moved the finish() to different places, still cant figure why it wont work. Any suggestions on where to move it/other reasons why I can't get from the splash screen to menu screen?
Or maybe if there is a simple code to just keep the splash up for 2-5 seconds then go to menu screen I can find somewhere?
This is where I got the info from, the finish() is before the startActivity in there. It's actually a copy from that tutorial. Yet still I can not transition to the menu page
What happens when you run the app? Does it show the splash screen? Does it freeze up? Does it crash? If it crashes, what do you get in the log? Can you paste the exception & stack trace if there is one.
If it was my code I'd forget the splash screen for now, and check to see if the menu activity can be started without any of the additional complications. Make the code as simple as possible in order to launch the activity. If it still doesn't work then at least you can rule out the splash screen and thread.
Mark
p.s.
Quote:
Originally Posted by jonbonazza
Also, in splash java, there is really no need to put that in a new thread. just doing all of that in the UI thread would be fine.
Are you sure about that?
Doing a loop and sleeping in the GUI thread sounds like a bad idea to me.
The code won't return from onCreate() until the loop finishes.
It's quite possible that the GUI won't be updated until Android gets control back, after you return from onCreate(). In which case the splash screen won't appear.
And in general, keeping a GUI thread busy is considered bad practice, as it'll stop responding to the user.
In the emulator (debug run) it shows the splash screen for about 5 seconds and then goes back to the application menu. And I would like to get this to work because I will need to learn how to get from one activity to another for the menu buttons as well, which I again I apologize for being so new to this and seeking help far beyond what I should be trying to do.
Try changing the finally clause of your try/catch to this:
Code:
Intent intentLaunchMenu = new Intent(SplashActivity.this, MenuActivity.class);
startActivity(intentLaunchMenu);
finish();
Take out the stop(); It's not necessary (and is deprecated) as your thread is about to end.
From the Android documentation on Thread:
Quote:
stop()
This method is deprecated. because stopping a thread in this manner is unsafe and can leave your application and the VM in an unpredictable state.
Last edited by andywhoa; July 23rd, 2010 at 02:03 PM.
This is needed because the name gets added to the package name. Currently yours would compile android.bankclosuresMenuActivity instead of android.bankclosures.MenuActivity.
Try doing what I've told you in my last two posts and see if that helps