0


I am getting Class Not Found exception in 4.0.3 on doing below.. Class<?> notifyBuilder = null; try { notifyBuilder = Class.forName("android.app.Notification.Builder"); } catch (Exception e) { e.printStackTrace(); }

Plz Help..

NitZRobotKoder
  • 1,046
  • 8
  • 44
  • 74
  • this may help u http://stackoverflow.com/a/10046725/1289716 – MAC May 28 '12 at 11:27
  • 2
    shouldn't be `android.app.Notification$Builder` since `Notification` is class and `Builder` is inner class of it? – Selvin May 28 '12 at 11:27
  • @Selvin It Worked with Notification$Builder thanks..But it works well for android.app.AlertDialog.Builder Strange Right!!!??? – NitZRobotKoder May 28 '12 at 11:30
  • 1
    Is there a reason why you are accessing this via reflection? Bear in mind that the Android Support package has `NotificationCompat.Builder` that you can use going back to API Level 4. – CommonsWare May 28 '12 at 11:38
  • Was trying to Fix this..http://stackoverflow.com/questions/8350615/notification-number-and-ice-cream-sandwich my app is intended to run on 2.2 onwards.. – NitZRobotKoder May 28 '12 at 11:43
  • `Notification.Builder` has no impact on where the number is displayed. – CommonsWare May 28 '12 at 11:58
  • @CommnsWare it does have Effect in ICS, Number will Displayed once u drag N Tray!!! – NitZRobotKoder May 28 '12 at 17:40

3 Answers3

2

You will need to download the compatibility library for phones that are older than 3.0. You can find more information about that here:

http://developer.android.com/tools/extras/support-library.html

Also, here is a link that will help with how to implement the notifications using the "NotificationCompat.Builder" (note the postfix Compat):

How exactly to use Notification.Builder

Community
  • 1
  • 1
David Rutgos
  • 149
  • 2
  • 12
0

Using this Worked "android.app.Notification$Builder"

NitZRobotKoder
  • 1,046
  • 8
  • 44
  • 74
0

this worked for my 4.0.3 android app web tutorial

nkvnkv
  • 914
  • 2
  • 12
  • 25