3

I'm hoping someone can help shed some light on this. I have this code that works fine with API Version 10. However, when I switch to API 16, the first component gets loaded, but the second one throws an exception it doesn't exist in the application.

Nothing changes except the change of the API. Can anyone shed any light on this please? I've been searching and haven't ran across anything yet.

Thanks!

     /***************************************************
     * INITIATE THE BROADCAST RECEIVERS
     **************************************************/
    //create reference to the package manager and required receivers
    PackageManager pm  = getApplicationContext().getPackageManager();

    ComponentName BroadcastReceiver_Text = 
        new ComponentName(this, TextMessageReceiver.class.getName());
    ComponentName BroadcastReceiver_Phone = 
        new ComponentName(this, PhoneCallReceiver.class.getName());

    //turn ON the broadcast receivers for the texting
    try {
        pm.setComponentEnabledSetting(BroadcastReceiver_Text,
                PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
                PackageManager.DONT_KILL_APP);
        Log.i("Broadcast Receiver for Text", "Is Now ENABLED");
        //turn ON the broadcast receivers for the phone calls

        pm.setComponentEnabledSetting(BroadcastReceiver_Phone,
                PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
                PackageManager.DONT_KILL_APP);
        Log.i("Phone Receiver for Text", "Is Now ENABLED");

    }catch(Exception e){
        Log.i("NameNotFoundException", e.getMessage());
    }
        Log.i("AwayModeService", "OnCreate Ending");
}
Briana Finney
  • 1,171
  • 5
  • 12
  • 22
  • Please provide the full stack trace. – CommonsWare Oct 24 '12 at 19:00
  • @CommonsWare -I found it. I somehow deleted the required code in the manifest file. I need to walk away for a bit at this point, I think. Ugh! Thanks so much for the willingness to help. (I'm not sure how to format this code) ' ' – Briana Finney Oct 24 '12 at 19:14

0 Answers0