Alarm Manager

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

Alarm Manager

Postby nithin.warier » Fri Mar 14, 2008 3:18 pm

I tried to display a page and after 15 seconds next page will come using thsi code, but its not displaying ..

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. public class TimeOut extends Activity {
  2.  
  3.  
  4.  
  5.     @Override
  6.  
  7.     public void onCreate(Bundle icicle) {
  8.  
  9.         super.onCreate(icicle);
  10.  
  11.         setContentView(R.layout.main);
  12.  
  13.         Calendar calendar = Calendar.getInstance();
  14.  
  15.         calendar.setTimeInMillis(System.currentTimeMillis());
  16.  
  17.         calendar.add(Calendar.SECOND, 15);
  18.  
  19.        
  20.  
  21.         Intent intent = new Intent(TimeOut.this, NewPage.class);
  22.  
  23.        
  24.  
  25.         AlarmManager am = (AlarmManager)getSystemService(ALARM_SERVICE);
  26.  
  27.         am.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), intent);
  28.  
  29.    }
  30.  
  31. }
Parsed in 0.031 seconds, using GeSHi 1.0.8.4



The newpage is

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. public class NewPage extends Activity {
  2.  
  3.     @Override
  4.  
  5.     public void onCreate(Bundle icicle)
  6.  
  7.     {
  8.  
  9.         super.onCreate(icicle);
  10.  
  11.         setContentView(R.layout.newpage);
  12.  
  13.     }
  14.  
  15.  
  16.  
  17. }
Parsed in 0.031 seconds, using GeSHi 1.0.8.4

please tell how to solve ..........

Thanks
Nithin
nithin.warier
Experienced Developer
Experienced Developer
 
Posts: 87
Joined: Thu Feb 28, 2008 12:05 pm
Location: Malappuram Kerala India

Top

Postby nithin.warier » Fri Mar 14, 2008 3:24 pm

TimeoutPage is coming but NewPage is not coming... means AlarmManager is not working..

anyone find out the problem

Thanks
Nithin
nithin.warier
Experienced Developer
Experienced Developer
 
Posts: 87
Joined: Thu Feb 28, 2008 12:05 pm
Location: Malappuram Kerala India

Postby nithin.warier » Fri Mar 14, 2008 3:40 pm

I added receiver to android manifest
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.   <receiver android:name=".NewPage" android:process=":remote" />
Parsed in 0.001 seconds, using GeSHi 1.0.8.4


now alarm manager is working, but after 15 seconds ahowing unable to instantiate receiver

anyone solved

Thanks
Nithin
nithin.warier
Experienced Developer
Experienced Developer
 
Posts: 87
Joined: Thu Feb 28, 2008 12:05 pm
Location: Malappuram Kerala India

Postby nithin.warier » Fri Mar 28, 2008 6:27 am

NewPage extends IntentReceiver is needed...... now got it..
nithin.warier
Experienced Developer
Experienced Developer
 
Posts: 87
Joined: Thu Feb 28, 2008 12:05 pm
Location: Malappuram Kerala India

Alarm

Postby E.Jyothsna » Fri Apr 04, 2008 6:56 am

in my application i set alarm with message.At that particular time it will show the only message.How can i get alarm sound.Is it possible to get alarm.Plz reply me
E.Jyothsna
Junior Developer
Junior Developer
 
Posts: 22
Joined: Thu Feb 28, 2008 12:25 pm
Location: chennai

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 11 guests