![]() ![]() ![]() PendingIntent pintent2 = PendingIntent.getActivity(Rules.this, 0, intent2,ĪlarmManager alarm2 = (AlarmManager) getSystemService(Context.ALARM_SERVICE) ĪtRepeating(AlarmManager.RTC_WAKEUP, cal. I dont know which api do you test, but there are some restrictions. ![]() ![]() Intent intent2 = new Intent(Rules.this, KillTimer.class) Use PendingIntent.FLAGIMMUTABLE in PendingIntent in NotificationMgr Require that the PendingIntent be immutable so that a malicious app is not able to. However the source code never recognizes it and the Alarm never wakes the activity as it did before I added the string for time.ĬODE SNIPPET: (Alarm which will not start using the value of the string: time) // Start 2nd service using AlarmManager getLaunchIntentForPackage ('my.package.name') If your app is already running, this will bring the app to the foreground without creating any new components. Use a 'launch Intent' in your Notification: val intent getPackageManager (). The time string should represent which can be multiplied by 1000 on the following line: You should just do what Android does when it launches an app from the HOME screen. I think it may have to do with the way I've implemented the time string - but I'm really not sure. I'm sure I've overlooked something simple but I'm not sure what it might be. The textview displays the correct time for the string: time however it never appears to start the 2nd AlarmManager's Activity (KillTimer.java) and I'm not sure why. I have 2 instances of AlarmManager built into my source code - the 2nd of which is supposed to start an Activity at the time specified by the string: time. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |