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

  • Home
  • SEARCH
  • 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 8652813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:23:41+00:00 2026-06-12T14:23:41+00:00

I try to fire intent from notification: CharSequence tickerText = ServiceTicker; // context.getString(R.string.service_ticker_registered_text); long

  • 0

I try to fire intent from notification:

CharSequence tickerText = "ServiceTicker"; // context.getString(R.string.service_ticker_registered_text);
long when = System.currentTimeMillis();

Builder nb = new NotificationCompat.Builder(context);
nb.setTicker(tickerText);
nb.setWhen(when);
Intent notificationIntent = new Intent(context, AccountRegistrationChanged.class);

notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);

RegistrationNotification contentView = new RegistrationNotification(context.getPackageName());
contentView.clearRegistrations();
if(!Compatibility.isCompatible(9)) {
    contentView.setTextsColor(notificationPrimaryTextColor);
}
contentView.addAccountInfos(context, activeAccountsInfos);

nb.setOngoing(true);
nb.setOnlyAlertOnce(true);
nb.setContentIntent(contentIntent);
nb.setContent(contentView);

Notification notification = nb.build();
notification.flags |= Notification.FLAG_NO_CLEAR;
// We have to re-write content view because getNotification setLatestEventInfo implicitly
notification.contentView = contentView;
Log.e(THIS_FILE, "==============notification:" + notification + " contentView:" + contentView + " notificationIntent:" + notificationIntent + " contentIntent" + contentIntent + " context:" + context + " nb:" + nb);

if (showNumbers) {
    // This only affects android 2.3 and lower
    notification.number = activeAccountsInfos.size();
}
startForegroundCompat(REGISTER_NOTIF_ID, notification);

private void startForegroundCompat(int id, Notification notification) {
    // If we have the new startForeground API, then use it.
    if (mStartForeground != null) {
        Log.e(THIS_FILE, "mStartForeground");

        mStartForegroundArgs[0] = Integer.valueOf(id);
        mStartForegroundArgs[1] = notification;
        invokeMethod(mStartForeground, mStartForegroundArgs);
        return;
    }
    Log.e(THIS_FILE, "invokeMethod");

    // Fall back on the old API.
    mSetForegroundArgs[0] = Boolean.TRUE;
    invokeMethod(mSetForeground, mSetForegroundArgs);
    notificationManager.notify(id, notification);
}

and finally i have in logs, where is all intent and view created correctly:

10-04 22:38:49.344: E/Notifications(7415):

==============notification:Notification(vibrate=null,sound=null,defaults=0x0) contentView:com.csipsimple.widgets.RegistrationNotification@44eb3ff8
notificationIntent:Intent { flg=0x10000000
cmp=com.callsfreecalls.android/.AccountRegistrationChanged }
contentIntentPendingIntent{44eb3fe8: android.os.BinderProxy@44f08f98}
context:com.csipsimple.service.SipService@44e9c328
nb:android.support.v4.app.NotificationCompat$Builder@44eb3e30 10-04
22:38:49.344: E/Notifications(7415): mStartForeground

10-04 22:38:49.344: E/Notifications(7415): mStartForeground

but nothing happened, this code:

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Log.e(THIS_FILE, "AccountRegistrationChanged");

    setContentView(R.layout.activity_account_registration_changed);
}

not started in Activity/AccountRegistrationChanged…

here is manifest for Activity:

<activity
    android:name=".AccountRegistrationChanged"
    android:label="@string/title_activity_account_registration_changed" >
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />

        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>

Any suggestion? maybe i have to fire anything more to push notification start intent?
Currently i just need activate some elements from another Activity, but code with handler (below is described) caused unknown error without any explanation in debug:

SipProfileState ps = activeAccountsInfos.get(i);
Message msg = new Message();
Bundle b = new Bundle();
b.putString("regState",String.valueOf(ps.getStatusCode()));
msg.setData(b);
PhonePadActivity.getUareceiverhandler().sendMessage(msg);
  • 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-12T14:23:43+00:00Added an answer on June 12, 2026 at 2:23 pm

    Perhaps the onNewIntent() method of your AccountRegistrationChanged activity is being fired instead of onCreate(). Has the AccountRegistrationChanged activity already been created before your notification?

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

Sidebar

Related Questions

I'd like to fire an intent from the onChange() method of my ContentObserver .
I have an event, which can fire itself. I try to make the code
I have 2 insert triggers, that fire on same table, they both try to
Try this code - import java.io.StringReader; public class StringReaderTest { public static void main(String[]
Try this piece of code - public class WhitespaceTest { public static void main(String[]
try { if (myBoolean) { while (true) ; } else { System.exit(1); } }
I have an application that calls AlarmManager Intent intent; intent = new Intent(context, MyEventReceiver.class);
When I try to load two of the same page from my server in
Fire up your firebug console and try this out. Compare this: $('body').data('x',1); $(thisx).remove(); console.log($('body').data('x'));
i try a simple Delegate but the method won't fire. Here is my code:

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.