Why Pending Intent Not BroadCasting And give Exception?
<p>I making App Which flow Is as_</p>

<p>1- After successfully login in facebook fetch all friends IDs and store into Arraylist.
   2- After that I am setting alarmManaget execute one time a day which code is as:-</p>

<pre><code>@Override
protected void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.friendlist);
    lvfrnd = (ListView)findViewById(R.id.listview);
    Bundle mbundle = getIntent().getExtras();
    if(mbundle!=null &amp;&amp; Constant.isService==false )
    {
        appId = mbundle.getString("appid");
    }
    if(mbundle!=null &amp;&amp; Constant.isService==true )
    {
        isSuccess = mbundle.getString("success");
    }
    mUserIdFetcher = new UserIdFetcher();
    mfriendIdlist = mUserIdFetcher.getFriendIdList(appId);
    String friendId = makeStringOfId(mfriendIdlist);
    SharedPreferences mprePreferences = getSharedPreferences(PREFS_NAME, MODE_PRIVATE);
    SharedPreferences.Editor editor = mprePreferences.edit();
    editor.putString("userId", friendId);
    editor.commit();
    setAlarmManager(appId);
    setListView();
 }

private String makeStringOfId(ArrayList&lt;String&gt;  mfIdlist)
{
    int length =0;
    String midstring = "";
    if(mfIdlist!=null)
    {
         length = mfIdlist.size();
    }

    for(int mindex =0;mindex&lt;length;mindex++)
    {
        midstring = midstring+mfIdlist.get(mindex)+"/";
    }
    return midstring;

}

private void setAlarmManager(String appid)
 {
    // add minutes to the calendar object
       Calendar updateTime = Calendar.getInstance();
        updateTime.setTimeZone(TimeZone.getDefault());
        updateTime.set(Calendar.HOUR_OF_DAY,10);
        updateTime.set(Calendar.MINUTE,42);

   Intent mintent = new Intent(this,BirthDayReciever.class);
   mintent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
   PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, mintent, PendingIntent.FLAG_CANCEL_CURRENT);
   AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
   // should be AlarmManager.INTERVAL_DAY (but changed to 15min for testing)
   alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, updateTime.getTimeInMillis(), AlarmManager.INTERVAL_DAY, pendingIntent);
   System.out.println("call--------------1");
 }

 private void setListView()
 {
     if(Constant.mfriendInfolist!=null &amp;&amp;Constant.mfriendInfolist.size()&gt;0)
     {
       mlistcustomer = new ListCustomAdapter(Friendlist.this,Constant.mfriendInfolist);
       lvfrnd.setAdapter(mlistcustomer);
       mlistcustomer.notifyDataSetChanged(); 
     }
  }
</code></pre>

<p>in above Activity when execution reach at pending Intent This Exception occurs :-</p>

<pre><code>     07-16 10:44:26.193: E/AndroidRuntime(773): Uncaught handler: thread main exiting due to uncaught exception
     07-16 10:44:26.333: E/AndroidRuntime(773): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.bday.Alarm/com.bday.Alarm.Friendlist}: java.lang.IllegalArgumentException: Can't use FLAG_RECEIVER_BOOT_UPGRADE here
   07-16 10:44:26.333: E/AndroidRuntime(773):   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2596)
    07-16 10:44:26.333: E/AndroidRuntime(773):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2621)
    07-16 10:44:26.333: E/AndroidRuntime(773):  at android.app.ActivityThread.access$2200(ActivityThread.java:126)
   07-16 10:44:26.333: E/AndroidRuntime(773):   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1932)
    07-16 10:44:26.333: E/AndroidRuntime(773):  at android.os.Handler.dispatchMessage(Handler.java:99)
   07-16 10:44:26.333: E/AndroidRuntime(773):   at android.os.Looper.loop(Looper.java:123)
    07-16 10:44:26.333: E/AndroidRuntime(773):  at android.app.ActivityThread.main(ActivityThread.java:4595)
    07-16 10:44:26.333: E/AndroidRuntime(773):  at java.lang.reflect.Method.invokeNative(Native Method)
   07-16 10:44:26.333: E/AndroidRuntime(773):   at java.lang.reflect.Method.invoke(Method.java:521)
  07-16 10:44:26.333: E/AndroidRuntime(773):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
   07-16 10:44:26.333: E/AndroidRuntime(773):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
    07-16 10:44:26.333: E/AndroidRuntime(773):  at dalvik.system.NativeStart.main(Native Method)
    07-16 10:44:26.333: E/AndroidRuntime(773): Caused by: java.lang.IllegalArgumentException: Can't use FLAG_RECEIVER_BOOT_UPGRADE here
    07-16 10:44:26.333: E/AndroidRuntime(773):  at android.os.Parcel.readException(Parcel.java:1222)
    07-16 10:44:26.333: E/AndroidRuntime(773):  at android.os.Parcel.readException(Parcel.java:1206)
    07-16 10:44:26.333: E/AndroidRuntime(773):  at android.app.ActivityManagerProxy.getIntentSender(ActivityManagerNative.java:2065)
    07-16 10:44:26.333: E/AndroidRuntime(773):  at android.app.PendingIntent.getBroadcast(PendingIntent.java:230)
    07-16 10:44:26.333: E/AndroidRuntime(773):  at com.bday.Alarm.Friendlist.setAlarmManager(Friendlist.java:102)
   07-16 10:44:26.333: E/AndroidRuntime(773):   at com.bday.Alarm.Friendlist.onCreate(Friendlist.java:71)
   07-16 10:44:26.333: E/AndroidRuntime(773):   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
   07-16 10:44:26.333: E/AndroidRuntime(773):   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2544)
   07-16 10:44:26.333: E/AndroidRuntime(773):   ... 11 more
</code></pre>

<p>Broadcast class start srvice which fetch User's facebook friends information name ,birthdate and set into object class and put that class into arralist and show that arraylist into Listview I am using Broadcast for updating this friendLIst one time a day My Service class is as:-</p>

<pre><code> public static final String PREFS_NAME = "MyPrefsFile";
 String [] friendFBId=null;



public UIUpdater(String name)
{

    super("UIUpdater");
    System.out.println("call--------------3");
    SharedPreferences mprePreferences = getSharedPreferences(PREFS_NAME, MODE_PRIVATE);
    String stringofUserId = mprePreferences.getString("userId","");
    if(stringofUserId!=null)
    {
        friendFBId = stringofUserId.split("/"); 
    }


}

@Override
protected void onHandleIntent(Intent intent) 
{

    Log.d("check--------------", "entered DisplayLoggingInfo");

    URL img_value = null;

    Bundle params =new Bundle();
    int length = friendFBId.length;

    String mAccessdata=Facebook.getAccessToken();

         try {
             System.out.println("fdartr");
            params.putString("format", "json");
            params.putString("access_token", mAccessdata);
            if(friendFBId!=null &amp;&amp; friendFBId.length&gt;0)
            {
                FriendsObject mFriendsObject = null;

                for(int mindex =0;mindex&lt;10;mindex++)
                {
                      mFriendsObject = new FriendsObject();
                     String url = "https://graph.facebook.com/"+friendFBId[mindex];
                     System.out.println("infourl   "+url);
                     String response = Util.openUrl(url, "GET", params);
                        JSONObject json = new JSONObject(response);

                        try {
                            String name=json.getString("name");
                            mFriendsObject.setName(name);
                        } catch (Exception e) {
                            e.printStackTrace();
                        }

                        try {
                            String fname = json.getString("first_name");
                            mFriendsObject.setFirst_name(fname);
                        } catch (Exception e) {
                            e.printStackTrace();
                        }

                        try {
                            String lname = json.getString("last_name");
                            mFriendsObject.setLast_name(lname);
                        } catch (Exception e) {
                            e.printStackTrace();
                        }

                        try {
                            String gender = json.getString("gender");
                            mFriendsObject.setGender(gender);
                        } catch (Exception e) {
                            e.printStackTrace();
                        }

                        try {
                            String location = json.getString("locale");
                            mFriendsObject.setLocale(location);
                        } catch (Exception e) {
                            e.printStackTrace();
                        }

                        try {
                            String web = json.getString("link");
                            mFriendsObject.setLink(web);
                        } catch (Exception e) {
                            e.printStackTrace();
                        }

                        try {
                            String bdate=json.getString("birthday");
                            mFriendsObject.setBirthday(bdate);
                        } catch (Exception e) {
                            e.printStackTrace();
                        }

                        try {
                            String username=json.getString("username");
                            mFriendsObject.setUsername(username);
                        } catch (Exception e) {
                            e.printStackTrace();
                        }

                        try {
                            String imgurl =" http://graph.facebook.com/"+friendFBId[mindex]+"/picture";
                            System.out.println("imgurl  ========= "+imgurl);
                            mFriendsObject.setImgUrl(imgurl);
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                        System.out.println("================="+Constant.mfriendInfolist.size());
                        Constant.mfriendInfolist.add(mindex,mFriendsObject);
                }
            }

        } catch (Exception e) {
            e.printStackTrace();
        }
        Bundle mbundle = new Bundle();
        intent = new Intent(this,Friendlist.class);
        Constant.isService = true;
        mbundle.putString("success","SUCCESS");
        startActivity(intent);
}
</code></pre>

<p>After execution of Broadcast this exception occure:-</p>

<pre><code>  07-16 11:39:01.443: E/AndroidRuntime(1012): Uncaught handler: thread main exiting due to uncaught exception
  07-16 11:39:01.463: E/AndroidRuntime(1012): java.lang.RuntimeException: Unable to instantiate service com.bday.Alarm.UIUpdater: java.lang.InstantiationException: com.bday.Alarm.UIUpdater
  07-16 11:39:01.463: E/AndroidRuntime(1012):   at android.app.ActivityThread.handleCreateService(ActivityThread.java:2878)
  07-16 11:39:01.463: E/AndroidRuntime(1012):   at android.app.ActivityThread.access$3200(ActivityThread.java:126)
   07-16 11:39:01.463: E/AndroidRuntime(1012):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1986)
  07-16 11:39:01.463: E/AndroidRuntime(1012):   at android.os.Handler.dispatchMessage(Handler.java:99)
  07-16 11:39:01.463: E/AndroidRuntime(1012):   at android.os.Looper.loop(Looper.java:123)
  07-16 11:39:01.463: E/AndroidRuntime(1012):   at android.app.ActivityThread.main(ActivityThread.java:4595)
  07-16 11:39:01.463: E/AndroidRuntime(1012):   at java.lang.reflect.Method.invokeNative(Native Method)
  07-16 11:39:01.463: E/AndroidRuntime(1012):   at java.lang.reflect.Method.invoke(Method.java:521)
   07-16 11:39:01.463: E/AndroidRuntime(1012):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
    07-16 11:39:01.463: E/AndroidRuntime(1012):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
   07-16 11:39:01.463: E/AndroidRuntime(1012):  at dalvik.system.NativeStart.main(Native Method)
  07-16 11:39:01.463: E/AndroidRuntime(1012): Caused by: java.lang.InstantiationException: com.bday.Alarm.UIUpdater
      07-16 11:39:01.463: E/AndroidRuntime(1012):   at java.lang.Class.newInstanceImpl(Native Method)
      07-16 11:39:01.463: E/AndroidRuntime(1012):   at java.lang.Class.newInstance(Class.java:1479)
     07-16 11:39:01.463: E/AndroidRuntime(1012):    at android.app.ActivityThread.handleCreateService(ActivityThread.java:2875)
      07-16 11:39:01.463: E/AndroidRuntime(1012):   ... 10 more
</code></pre>
