AlarmManager에서 설정한 시간에 BroadCastReceiver가 불러지고 Activity를 실행하는 방식입니다.(Acitvity 디자인을 Dialog 스타일로 만들어놨습니다.)

구글 오픈소스 AlarmClock을 참고해서 만들었는데 그쪽에서는 나타나지 않는 어플리케이션 이름이 나타나네요; 어디서 놓친건지.. 스샷이랑 소스코드 올립니다.

<testAlarmManager.java>
package my.testAlarmManager;

import android.app.Activity;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Intent;
import android.os.Bundle;
import android.os.SystemClock;
import android.widget.Toast;

public class testAlarmManager extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
       
        Intent intent = new Intent(testAlarmManager.this, AlarmService_Service.class);
        PendingIntent sender = PendingIntent.getBroadcast(
          testAlarmManager.this,
          0,
          intent,
          0);
       
        long time = SystemClock.elapsedRealtime();
        time += 10*100;
       
        AlarmManager am = (AlarmManager)getSystemService(ALARM_SERVICE);
        am.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, time, sender);
       
        Toast.makeText(this, Long.toString(time), Toast.LENGTH_LONG).show();
    }
}


<AlarmService_Service.java>
package my.testAlarmManager;

import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;

public class AlarmService_Service extends BroadcastReceiver{

 @Override
 public void onReceive(Context context, Intent intent)
 {
  Intent notify = new Intent(context, AlarmAlert.class);
  PendingIntent sender = PendingIntent.getActivity(context, 0, notify, 0);
  try
  {
   
   sender.send();
  }
  catch(Exception ex)
  {
   
  }
 }
}


<AlarmAlert.java>
package my.testAlarmManager;

import android.app.Activity;
import android.os.Bundle;
import android.view.LayoutInflater;


public class AlarmAlert extends Activity {
 public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  
  LayoutInflater inflater = LayoutInflater.from(this);
  setContentView(inflater.inflate(R.layout.alarm_alert, null));
 }
}


<androidManifest.xml>
<?xml version="1.0" encoding="utf-8"?>
<manifest package="my.testAlarmManager"
      android:versionCode="1"
      android:versionName="1.0" xmlns:android="http://schemas.android.com/apk/res/android">
    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".testAlarmManager"
                  android:label="@string/app_name" android:launchMode="singleInstance" android:excludeFromRecents="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    <receiver android:name="AlarmService_Service"></receiver>
<activity android:name="AlarmAlert" android:theme="@style/alarm_alert" android:launchMode="singleInstance" android:excludeFromRecents="true">
</activity>
</application>


</manifest>



[추가]

<alarm_alert.xml>
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2007 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:gravity="center">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:gravity="center_horizontal"
        android:background="@drawable/dialog"
        android:orientation="vertical">

        <LinearLayout
         android:id="@+id/LinearLayout01"
         android:layout_height="wrap_content"
         android:orientation="horizontal"
         android:layout_width="fill_parent">
         <ImageView
          android:id="@+id/ImageView01"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:src="@drawable/kalarm">
         </ImageView>
         <TextView
          android:id="@+id/alertTitle"
          style="?android:attr/textAppearanceLarge"
          android:singleLine="true"
          android:ellipsize="end"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
         android:text="테스트 알람"/>
</LinearLayout>
        <ImageView
            android:layout_width="fill_parent"
            android:layout_height="1dip"
            android:scaleType="fitXY"
            android:gravity="fill_horizontal"
            android:src="@*android:drawable/dialog_divider_horizontal_light"
            android:layout_marginLeft="10dip"
            android:layout_marginRight="10dip"/>
            <LinearLayout
             android:id="@+id/LinearLayout02"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:orientation="vertical">
             <TextView
              android:id="@+id/TextView02"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:textSize="17px"
              android:text="종각역 3번출구 가서 학교 부랑자들 만나기">
             </TextView>
             <TextView
              android:id="@+id/TextView01"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="2010-03-21 AM 12:02"
              android:textStyle="italic">
             </TextView>
            </LinearLayout>

        <LinearLayout
            android:id="@+id/clockView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:layout_gravity="fill_vertical|center"/>

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            style="@android:style/ButtonBar">

           

            <!-- blank stretchable view -->
           

            <Button
                android:id="@+id/dismiss"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="3" android:text="Dismiss"/>

        </LinearLayout>

 


</LinearLayout>

</LinearLayout>


id: bopduk//알터박스가 어떤걸 말씀하시는건지 잘 모르겠네요;bopduk//
알터박스가 어떤걸 말씀하시는건지 잘 모르겠네요;