7
स्टेटस बार पर टेक्स्ट कैसे सेट करें (लाइन जो बैटरी लाइफ, टाइम ..etc रखती है)?स्टेटस बार पर टेक्स्ट कैसे सेट करें?
अग्रिम धन्यवाद।
स्टेटस बार पर टेक्स्ट कैसे सेट करें (लाइन जो बैटरी लाइफ, टाइम ..etc रखती है)?स्टेटस बार पर टेक्स्ट कैसे सेट करें?
अग्रिम धन्यवाद।
आपको Status Bar Notification का उपयोग करने की आवश्यकता है।
//Create the Notification
Notification notification = new Notification(
android.R.drawable.stat_sys_warning, //Icon to use
"Hello World!", //Text
System.currentTimeMillis() //When to display - i.e. now
);
//Create a PendingIntent to do something when the user clicks on the Notification
//Normally this would be something in your own app
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setData(Uri.parse("http://www.stackoverflow.com"));
PendingIntent pi = PendingIntent.getActivity(this, 0, intent, 0);
//Add the detail to the Notification
notification.setLatestEventInfo(
getApplicationContext(),
"Stack Overflow", //Title of detail view
"This will launch Stack Overflow", //Text on detail view
pi
);
//Display the Notification
NotificationManager nm = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
nm.notify(ID_HELLO_WORLD, notification); //ID_HELLO_WORLD is a int ID