Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Intents and Broadcast Receivers Local Notifications Creating a Local Notification

Rifqi Fahmi
Rifqi Fahmi
23,164 Points

Help Challenge Task 2 of 5 error !!??

The instruction say: Next we want to build the notification with an icon, title, and text. Set the icon to R.drawable.ic_distress, the title to Incoming Distress Signal, and the text as A distress call has been received from somewhere in space and time..

And my code below, but when I click the check work it says Bummer! Make sure you use the text specified in the instructions!

I clearly have the same exact text as the instruction says.

DistressCallReceiver.java
public class DistressCallReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        // Add your code here!
      Notification.Builder notif = new Notification.Builder(context);
        notif.setSmallIcon(R.drawable.ic_distress);
        notif.setContentTitle("Incoming Distress Signal");
        notif.setContentText("A distress call has been received from somewhere in space and time..");


    }
}

1 Answer

Rifqi Fahmi
Rifqi Fahmi
23,164 Points

DAMN!! I figured it out the answer is you JUST USE 1 DOT at the end of the notification text. huft it takes me 30 minutes to figure it out *mad mode on :(