Android Notification Without R.java
问题 I need to show local notification in Android. But Notification builder object should need any icon to show it in the status bar. It has a certain mandatory function like setSmallIcon(int) . It takes integer argument from R.java file. But I need to give direct image URL without using R.java file. Code: NotificationCompat.Builder builder = new Builder(getContext()); Notification notification = builder.setSmallIcon(R.drawable.ic_launcher) .setContentTitle(title) .setContentText(text) .build();