Posts

Showing posts with the label system

Unable to get system library for project

Image
You may not able to build your android project because android adt cannot find the system library for project. And following compile errors may occur due to that problem. The type java.lang.Object cannot be resolved. To solve the problem open build path for the project, and in Android tab select different project build target.

Creating and Showing an Android System Notification

A Android system notifications are normally used for sending notifications by Android services. Here how you create simple notification. public void showNotification(CharSequence message) { final int notifyRef = 1; final int notifyIcon = R.drawable.icon; final long notifyWhen = System.currentTimeMillis(); final String notifyService = Context.NOTIFICATION_SERVICE;   NotificationManager notifyManager = (NotificationManager)getSystemService(notifyService); Notification notification = new Notification( notifyIcon, message, notifyWhen);   Context context = getApplicationContext(); CharSequence notifyTitle = message; CharSequence notifyText = "You saved this message."; Intent notifyIntent = new Intent( this, MyAndroidSdkAppActivity2.class); PendingIntent contentIntent = PendingIntent.getActivity( this, 0, notifyIntent, 0); notification.setLatestEventInfo( context, notifyTitle, notifyText...