Handler Understanding

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

Handler Understanding

Postby kartik_trivedi » Wed Jan 21, 2009 7:30 am

I want my application to be executed after particular time. Will i have to use AlaramManager or Handler ? Will handler only executes message if application is running. How can i run my application in background ?
Sun Certified Java Developer
Forum Nokia Champion
kartik_trivedi
Developer
Developer
 
Posts: 28
Joined: Tue Jan 20, 2009 7:19 am

Top

Postby rakesh_mehta » Wed Jan 21, 2009 11:05 am

Hi Kartik..

Just use Thread for the particular time for the background process... :)
Rakesh
User avatar
rakesh_mehta
Experienced Developer
Experienced Developer
 
Posts: 73
Joined: Tue Oct 14, 2008 6:46 am
Location: Ahmedabad(India)

Postby MrSnowflake » Wed Jan 21, 2009 11:37 am

In this case, if you want to start you activity at a specific time, you should use AlarmManager. Handlers only work within your own Activity and Threads only work when you have an activity running, which isn't the case here.

AlarmManager is able to start your app when you want it too, which means it can even start it when the phone is in standby, so, in most cases, this isn't what you want.
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 14 guests