Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8265469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:48:58+00:00 2026-06-08T04:48:58+00:00

I am tinkering with the code for this new notification I’m trying to write.

  • 0

I am tinkering with the code for this new notification I’m trying to write. Seems like it would be more simple to do but for some reason its not agreeing with me. Its not giving me anything. No logcat, no output on the emulator. Nothing. So here is the modified code:

import android.app.Activity;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.widget.RemoteViews;

public class kickStart extends Activity {
NotificationManager nm;
Context context = this;
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
    Notification notification = new Notification();
    RemoteViews contentView = new RemoteViews(getPackageName(), R.layout.note);
    contentView.setImageViewResource(R.id.icon, R.drawable.ic_launcher);
    contentView.setTextViewText(R.id.title, "Custom notification");
    contentView.setTextViewText(R.id.text, "This is a custom layout");
    notification.contentView = contentView;
    Intent notificationIntent = new Intent(this, MainActivity.class);
    PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
    notification.contentIntent = contentIntent;
    notificationIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    nm.notify(R.id.layout, notification);
}
}

Logcat is not giving me any info Its like the app don’t exist even though its saying it installed.

Here is some other useful info:

[2012-07-22 12:57:21 - this1] Android Launch!
[2012-07-22 12:57:21 - this1] adb is running normally.
[2012-07-22 12:57:21 - this1] Performing com.example.this1.kickStart activity launch
[2012-07-22 12:57:21 - this1] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'test'
[2012-07-22 12:57:21 - this1] Uploading this1.apk onto device 'emulator-5554'
[2012-07-22 12:57:23 - this1] Installing this1.apk...
[2012-07-22 12:57:31 - this1] Success!
[2012-07-22 12:57:32 - this1] Starting activity com.example.this1.kickStart on device emulator-5554
[2012-07-22 12:57:33 - this1] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.this1/.kickStart }

So it installs it knows of a launcher it just wont run…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T04:48:59+00:00Added an answer on June 8, 2026 at 4:48 am

    Try setting an icon and tickerText to your notification:

    notification.icon = R.drawable.small_notification;
    notification.tickerText = "Text that scrolls across the status bar";
    

    Well, the tickerText is optional, but the icon is required. (Which makes sense when I think about it because how else would we see the notification in the status bar?)

    From Notification’s documentation:

    notifications with an invalid icon resource will not be shown.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been tinkering with IExternalizable , but I've noticed some unexpected behavior. I've got
Been tinkering with some code regarding setting the visibility of a drop down based
After tinkering with this for hours I am hoping someone can shed some insight
With this code vozhus very much in it for a long time tinkering that
I am tinkering with this code: var items; function getMessage(index) { if (index ==
I'm a relatively new java programmer and I've been tinkering around with this program
I'm new to tinkering with app.config and xml, and am currently doing some refactoring
I'm tinkering with some code and I realized something I never knew. A normal
I was trying out this code for getting a dropdown list populated by a
I was in the midsts of tinkering in android with the goal of trying

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.