This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Feb 1st, 2013  |  syntax: None  |  size: 0.88 KB  |  views: 19  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Intent serviceIntent = new Intent();
  2. serviceIntent.setAction(MessageReceiverService.ClassName);
  3. startService(serviceIntent);
  4.        
  5. <receiver android:name="com.app.proto1.service.StartupIntentReceiver" >
  6.     <intent-filter>
  7.         <action android:name="android.intent.action.BOOT_COMPLETED" />
  8.  
  9.         <category android:name="android.intent.category.HOME" />
  10.     </intent-filter>
  11. </receiver>
  12.        
  13. @Override
  14. public IBinder onBind(Intent arg0) {
  15.     // TODO Auto-generated method stub
  16.     return null;
  17. }
  18.  
  19. @Override
  20. public void onCreate() {
  21.     super.onCreate();
  22.  
  23.     Log.d(Tag, "onCreate()");
  24. }
  25.  
  26. @Override
  27. public void onDestroy() {
  28.     super.onDestroy();
  29.     Log.d(Tag, "onDestroy()");
  30. }
  31.  
  32. @Override
  33. public void onStart(Intent intent, int startId) {
  34.  
  35.     super.onStart(intent, startId);    
  36.     Log.d(Tag, "onStart()");
  37.     this.registerReceiver(new SmsReceiver(), new IntentFilter(SMS_ACTION));
  38. }
clone this paste RAW Paste Data