android programming question

This is a discussion on android programming question within the Droid Development forums, part of the Droid Hacking category; i'm not sure if this is the right place to ask this, so please direct me to the correct place if this is wrong. I ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: android programming question

  1. Beta Team
    mojo_droid's Avatar
    Member #
    86301
    Join Date
    Jul 2010
    Posts
    367
    Phone
    Enter Current Phone Model Here
    DroidForums.net Developer
    Premium Member
    #1

    android programming question

    i'm not sure if this is the right place to ask this, so please direct me to the correct place if this is wrong.

    I have an app that is constantly updated a notification in the status bar (changing the icon and updated text in the expanded view). The problem I am having is that when it updates the notification it will close the window I am in for certain actions. For example, if I am looking through my apps when it updates it will close that and take me to the home screen, if I am searching for something in the market it will close the search history, etc. Is there a way to have it update the icon and text in the background and not effect any currently running activity?

    here is my notification code:

    Code:
    public void displayNotification(String msg)
      {
        RemoteViews contentView = new RemoteViews(getPackageName(), R.layout.custom_notification_layout);
    
        settings = context.getSharedPreferences(PREFS_NAME, 0);
        statColor = settings.getInt("txtColor", Color.BLACK);
         contentView.setTextColor(R.id.text, statColor);
         contentView.setTextColor(R.id.text2, statColor);
         contentView.setTextColor(R.id.text3, statColor);
    
          contentView.setTextViewText(R.id.text, "some text");
          contentView.setTextViewText(R.id.text2, "some more text");
          contentView.setTextViewText(R.id.text3, "some more text");
    
          contentView.setImageViewResource(R.id.image, icon[iconIndex]);
          Notification notification = new Notification(icon[iconIndex], msg, System.currentTimeMillis());
          notification.contentView = contentView;
          Intent notificationIntent = new Intent(this, AppService.class);
          PendingIntent contentIntent = PendingIntent.getActivity(this, 1, notificationIntent, 0);
          notification.contentIntent = contentIntent;
    
          manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
          notification.flags |= Notification.FLAG_NO_CLEAR;
          notification.flags |= Notification.FLAG_ONGOING_EVENT;
          manager.notify(NOTIFICATION_ID, notification);
    
    
      }
  2. Sponsor
    DF Advertising
    Join Date
    Nov 2008
    Location
    DroidForums.net
     
     
     
     
  3. Beta Team
    mojo_droid's Avatar
    Member #
    86301
    Join Date
    Jul 2010
    Posts
    367
    Phone
    Enter Current Phone Model Here
    DroidForums.net Developer
    Premium Member
    #2
    you can delete this thread, i figured out the issue

Sponsors

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Similar Threads

  1. Programming a Graphic EQ ?
    By xsylus in forum Droid Development
    Replies: 8
    Last Post: 10-06-2011, 01:38 AM
  2. Is there a programming menu?
    By blitzgash in forum ChevyNo1
    Replies: 2
    Last Post: 07-07-2010, 08:24 PM
  3. Programming language
    By whteglve in forum Off Topic Forum
    Replies: 1
    Last Post: 02-18-2010, 12:24 PM
  4. Programming for the Droid
    By rudely in forum Droid General Discussions
    Replies: 1
    Last Post: 02-12-2010, 12:44 PM
  5. initial help at programming
    By apl3 in forum Hacking Help
    Replies: 1
    Last Post: 02-11-2010, 12:51 PM

Search tags for this page

android close contentview
,
android contentview required
,
android flag ongoing event
,
android forum programming
,
android forums for programming tips
,
android java.lang.illegalargumentexception: contentview requ
,
android notifications contentview required
,

android programming forum

,

android programming forums

,
android programming notification
,
android programming related forum
,

android remove content view

,

android remove contentview

,

android removecontentview

,
contentview required
,
is there removecontentview in android
,
notification contentview required
,
remove contentview android
,
removecontentview
,
removecontentview android
Click on a term to search our site for related topics.