NotificationShowcaseActivity.java revision e6ea907e7cf8eb8f8ab04f238ab834ba970b4f45
1// dummy notifications for demos 2// for anandx@google.com by dsandler@google.com 3 4package com.android.example.notificationshowcase; 5 6import android.app.Activity; 7import android.app.NotificationManager; 8import android.content.ComponentName; 9import android.content.Context; 10import android.content.Intent; 11import android.os.Bundle; 12import android.view.View; 13 14public class NotificationShowcaseActivity extends Activity { 15 private static final String TAG = "NotificationShowcase"; 16 @Override 17 public void onCreate(Bundle savedInstanceState) { 18 super.onCreate(savedInstanceState); 19 setContentView(R.layout.main); 20 } 21 22 public void doPost(View v) { 23 Intent intent = new Intent(NotificationService.ACTION_CREATE); 24 intent.setComponent(new ComponentName(this, NotificationService.class)); 25 startService(intent); 26 } 27 28 public void doRemove(View v) { 29 Intent intent = new Intent(NotificationService.ACTION_DESTROY); 30 intent.setComponent(new ComponentName(this, NotificationService.class)); 31 startService(intent); 32 } 33 34 public void doPrefs(View v) { 35 Intent intent = new Intent(); 36 intent.setComponent(new ComponentName(this, SettingsActivity.class)); 37 startActivity(intent); 38 } 39} 40