I am creating a custom lock screen so that in my activity the Status
bar won't be there.
At the mean time i want to get the the status bar notifications such
as missed calls, new chat messages, new emails, new voice-mail, etc...
How to implement this?
please give me a hint
Related
Currently, I am working with an app in which there is a functionality in which user clicks on a button and user is navigated directly to settings screen. Now, whenever user is on settings screen at that time I want to disable the interaction of user with notification bar. I have a service & receiver in my code and tried to set the disable notification code in service class but can't able to achieve this.
View decorView = context.getSystemService(Context.WINDOW_SERVICE).getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
I tried to use this but not able to succeed. Any help will be appreciable.
I am building a VoIP app and it has an incoming call screen. Instead showing the screen, I want to just show a heads up notification, if current foreground app is in full screen mode. Is this possible? Is there a way to check if the current running activity is in full screen?
WindowManager.LayoutParams lp = getWindow().getAttributes();
if(lp.flags == WindowManager.LayoutParams.FLAG_FULLSCREEN){
//Do your stuff
}
Edit
If the running app is not your app you need to take a different approach which possible only from API 11, and use View.OnSystemUiVisibilityChangeListener:
Callback to be invoked when the status bar changes visibility. This reports global changes to the system UI state, not what the application is requesting
I have a fairly basic android app that is a tabhost of 4 tabs, each one opens a webview. The app also has GCM all setup and currently can receive messages fine. When a message is received though, you click on it and it simply opens the app the same way clicking on the App icon would open the app. What I am trying to do though is open a particular tab inside the app when someone clicks on message and what would be even better is if I could open any tab depending on what the message is. Is this possible? If so, how would I go about doing this?
From what I have found so far, I think this involves something with adding an additional item in the payload of the message such as
{
"registration_id" : "APA91bHun4MxP5egoKMwt2KZFBaFUH-1RYqx...",
"data" : {
"message" : "Text notification goes here",
"tab" : "2"
},
}
and then possibly doing something with the intents which I am not sure how to do. Am I on the right track and can anyone help me with this?
You can add an extra to the pending intent that you pass to the notification that will indicate which tab to open.
And when the activity starts check for that extra and open the tab accordingly.
Is there a possibily within Android to get the state of the status bar, especially a new notification was added to it?
It need this to start an activity if something happend in the status bar. I don't mean the "Status bar windows".
Maybe I can use an IntentFilter like :
IntentFilter statusBarIntentFilter = new IntentFilter(android.bla.bla.ACTION_STATUSBAR_STATE_CHANGED);
Thank you so far in advanced!
BR
Is there a possibily within Android to get the state of the status bar, especially a new notification was added to it?
No, sorry. You cannot spy on other applications' notifications from the Android SDK.
Is there a possibily within Android to get the state of the status bar, especially a new notification was added to it?
You can listen for status bar notifications by using AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED.
Here is a StackOverflow answer on this subject, and here is a working example I put together based upon that answer. I actually put that example together because an application was, essentially, spamming my wife's notification bar with advertisements and there was no clear way of telling who the offending application was.
how can i show an AlertDialog in my activity, when the notification is clicked in notification area.
plz help....
i'm using multiple status bar notifications each with unique IDS.
I've solved a similar problem by having the notification intent open a new activity with a transparent background. The activity then spawns the AlertDialog.
Put some data to signal that an AlertDialog should be shown into a PendingIntent and put this into yourNotification.contentIntent of your notification. Display the AlertDialog from your Activity in case it receives this Intent.
Have a look at the Notifications Doc.