android - PendingIntent error ( Must be one or more of: PendingIntent.FLAG_ONE_SHOT …..) -


i trying create pendingintent in android. here code

mnotificationintent = new intent(getapplicationcontent(), myalarm.class); mcontentintent = pendingintent.getactivity(getapplicationcontext(),                    0, mnotificationintent, intent.flag_activity_new_task); 

and getting following error:

  must 1 or more of: pendingintent.flag_one_shot,pendingintent.flag_no_create,           pendingintent.flag_update_current,           intent.fill_in_action, intent.fill_in_data, intent.fill_in_categories…..) 

why error showing ? how resolve this? please help. thank you.

you passing intent.flag_activity_new_task when method call expects pendingintent flag. if want add intent.flag_activity_new_task intent, need this:

mnotificationintent = new intent(getapplicationcontent(), myalarm.class); mnotificationintent.addflags(intent.flag_activity_new_task); mcontentintent = pendingintent.getactivity(getapplicationcontext(),                0, mnotificationintent, 0); 

Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -