FileDocCategorySizeDatePackage
SimFullReceiver.javaAPI DocAndroid 1.5 API2545Wed May 06 22:42:46 BST 2009com.android.mms.transaction

SimFullReceiver

public class SimFullReceiver extends android.content.BroadcastReceiver
Receive Intent.SIM_FULL_ACTION. Handle notification that SIM is full.

Fields Summary
Constructors Summary
Methods Summary
public voidonReceive(android.content.Context context, android.content.Intent intent)

        if (Settings.Secure.getInt(context.getContentResolver(),
            Settings.Secure.DEVICE_PROVISIONED, 0) == 1 &&
            Telephony.Sms.Intents.SIM_FULL_ACTION.equals(intent.getAction())) {
            
            NotificationManager nm = (NotificationManager)
                context.getSystemService(Context.NOTIFICATION_SERVICE);

            Intent viewSimIntent = new Intent(context, ManageSimMessages.class);
            viewSimIntent.setAction(Intent.ACTION_VIEW);
            viewSimIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            PendingIntent pendingIntent = PendingIntent.getActivity(
                    context, 0, viewSimIntent, 0);

            Notification notification = new Notification();
            notification.icon = R.drawable.stat_sys_no_sim;
            notification.tickerText = context.getString(R.string.sim_full_title);
            notification.defaults = Notification.DEFAULT_ALL;
            
            notification.setLatestEventInfo(
                    context, context.getString(R.string.sim_full_title), 
                    context.getString(R.string.sim_full_body),
                    pendingIntent);
            nm.notify(ManageSimMessages.SIM_FULL_NOTIFICATION_ID, notification);
       }