android-notifications

Getting battery status even when the application is closed

好久不见. 提交于 2019-12-25 03:03:42
问题 Hey I am trying to make an application that tells me when the battery is full when the phone is connected to power. I made a service and used a broadcast receiver in that to check the battery status. Whenever i connect or disconnect the phone from the power, my app crashes. The service still runs and i get the notification when battery is full. I dont know why is the app crashing again and again. Here is my code public class Srvc extends Service{ @Override public int onStartCommand(Intent

Re initate Sync adapter in android

岁酱吖の 提交于 2019-12-25 02:57:34
问题 I'm able to successfully create Sync adapter in my phone, but i'm not able to handle a particular scenario. My task sync app, requires the tasks permission to fetch tasks or it applicable for getting permission for any service from Google server. this scenario occurs for the first time, if the user moves to Google account without launching the application. 1) Go to Settings --> Accounts and sync --> Choose a Google account, 2) there the tasks sync content provider will be present. 3) Once i

MediaStyleNotification: Play/Pause button does not respond to click

一笑奈何 提交于 2019-12-25 02:22:16
问题 In my app when the user chooses an audio file for playing, when the file is ready and the playback starts a MediaStyle Notification is shown successfully. The metadata info is updated, title, icon etc. But… 1.Play/Pause button does not respond to clicks. 2.Clicking the notification does not open the activity. 3.Swipe gesture triggers also… nothing I don’t know what I am missing. You can have a look at my MediaBrowserService class. 回答1: The code being discussed: private void

Why I get the Notification just opening the Activity?

感情迁移 提交于 2019-12-25 01:47:00
问题 Edit : DO anyone have a solution for this on STACKOVERFLOW ? I am using Firebase Database and wanted to show notification as soon as new child is added. I am using "ChildEventListener" to acquire it. Here is my code: dbProducts.addChildEventListener(new ChildEventListener() { @Override public void onChildAdded(@NonNull DataSnapshot dataSnapshot, @Nullable String s) { // Toast.makeText(ShowNotifActivity.this, "Child Added ", Toast.LENGTH_SHORT).show(); Intent intent = new Intent

Updating the UI upon receiving an android push notification

℡╲_俬逩灬. 提交于 2019-12-25 01:09:51
问题 I have a query regarding android push notification and i had asked it in another stackoverflow post and i did not get much help out of it [Query regarding Android push notifications. So i am posting it again, and it is as follows: I have an android app that receives push notifications from Google push notification service. When i tap on the received notification, it opens an UI which displays this message, it is a list view. Now, when the user receives the push notification, and assuming that

Android Notification without click event?

青春壹個敷衍的年華 提交于 2019-12-24 21:04:18
问题 I would like to try and make a Notification that does not respond to a click. Is this possible? i.e. when it is visible in the Notification area, and the user touches it, I want "nothing" to happen. This is different to a normal Notification - when it is visible, and the user touches it, the Notification Area hides, and the Intent is launched. I do not want the Notification Area to hide when it is touched. I can make one that doesn't launch an activity: Possible to make an Android

Android - How to stop showing notification when open application

醉酒当歌 提交于 2019-12-24 19:23:12
问题 I'm new to android development... trying to build application which send notification at specific time daily.First time if I tap on notification it opens application and notification doesn't come again. But after that if I open application it shows notification again.. how to stop showing it again? but show only at particular time? .. MainAcitivty code is: public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate

java.lang.IllegalArgumentException: contentIntent required

限于喜欢 提交于 2019-12-24 16:25:50
问题 The full error also contains: android.app.RemoteServiceException: Bad notification for startForeground: I've read other similar posts here, tried their suggestions and read their links, but a small number of users are still reporting this error. Overview An activity is started by an external application. This activity starts a custom speech recognition service. It does not use startForeground: this.startService(intent); The activity then calls finish(); The service starts the custom speech

Notification Click display unique data issue

倖福魔咒の 提交于 2019-12-24 16:00:23
问题 Not able to identify id for item clicked on notification was for unique id which is working out well,now for the same even with different id when i click on notifications i get unique invoice id ,which i am passing to a webservice to get its invoice details,even though its fetching data for that id,the itemActivity page is showing previous details only,how will i update the page with new contents ? Send Notification code is public class SampleSchedulingService extends IntentService { public

Find out whether notification channel is muted by the user

混江龙づ霸主 提交于 2019-12-24 11:53:43
问题 In my Android app there is a long-running service (export data) which shows progress and ends with a notification for the user to share the exported file. To be clear, it's not a push-notification, but a Notification created locally by new NotificationCompat.Builder(…).set…().build() . There are quite a lot of users which mute the notification channel (or globally disable notifications for my app). I don't know why, because it's really not very verbose, BTW. But those users feel like the app