Writing a restart function

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

Writing a restart function

Postby bloonlabs » Tue Dec 04, 2007 12:23 am

Hi guys, I am new to JAVA and Android, however I am catching on quickly due to my knowledge of PHP and C. Anyways, I am curious how to write a restart function. What I want to do is be able to modify my preferences file with new preferences then restart the activity to apply them. The reason I have to restart is because changing theme doesn't apply until you redraw everything... And the only way I know how to do that is to restart.

So I have been using finish(); and then just manually relaunching the app but doing that runs me into two errors:
1) Using finish(); seems to disable the touch screen until you press the home button
2) when I restart my app with its new theme applied, (I am going from theme_white to theme_dark) the buttons change theme but the background stays white... Wierd?

Any ideas on how to write a "restart" function that simply quits the activity and restarts it from scratch? Thanks!
bloonlabs
Freshman
Freshman
 
Posts: 7
Joined: Tue Dec 04, 2007 12:05 am

Top

Postby bloonlabs » Thu Dec 06, 2007 9:43 pm

Anyone? :D :wink:
bloonlabs
Freshman
Freshman
 
Posts: 7
Joined: Tue Dec 04, 2007 12:05 am

Postby plusminus » Thu Dec 06, 2007 11:16 pm

bloonlabs wrote:Anyone? :D :wink:


Sorry bloonlabs,

somehow I didn't see your topic o_O :!:

@ 1.)I'm using the finish(); Method to return from SubActivities and it works fine with me. It sounds like a bug. The "freeze" sounded like a bug to me. Tried it and it works with me :!:.

@ 2.)I've also had problems using the templates (not exactly these, but also that some things do not get applied :!: ).

Could you post the specific code :?:

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Exabot [Bot] and 14 guests