English 中文(简体)
通知案文明确了有关地位限制的新闻内容?
原标题:Notification text clears on press clear on status bar?
  • 时间:2012-05-07 06:53:48
  •  标签:
  • android

在我的申请书中,Im显示通知案文,Imcon on the communication bar,但我的问题是,当用户在通知栏上发布clear时,通知条码即已予清除。 我想预防吗? 还有一些其他问题:

  1. I want to create notifications for my application by different activities, say one on start it displays "Welcome to app", the second activity displays "please select", in "Data send activity" it displays "Records sent successfully"!!
  2. How to remove the notification on application exit.
  3. How to disable users to clear the notification when they press the clear button on the notification bar
  4. How to remove a notification from the status bar when the user presses it to open an activity?

任何帮助?

我目前的法典

private void Notification(String notificationTickerText, String Title,
            String text, Notification nt) {
        notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);

        int icon = R.drawable.nicon;
        CharSequence tickerText = notificationTickerText;

        long when = System.currentTimeMillis();
        nt = new Notification(icon, tickerText, when);

        Context context = getApplicationContext();
        CharSequence contentTitle = Title;
        CharSequence contentText = text;
        Intent notificationIntent = new Intent(this, frmLogin.class);

        PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
                notificationIntent, 0);

        nt.setLatestEventInfo(context, contentTitle, contentText, contentIntent);

        notificationManager.notify(1, nt);
    }
最佳回答

参看rel=“nofollow noreferer”>http://developer.android.com/guide/topics/ui/notifiers/notifications.html。 这或许会回答你的所有问题。

It mentions that you can use the following to prevent a notification from being cleared:

FLAG_NO_IED sign

在旗帜领域添加这一点,以表明通知不应由“单列通知”纽扣。 如果你的通知正在发出,这尤其有用。

你可以利用FLAG_AUTO_CompL取消你的通知,但我并不完全相信,如果与FLAG_NO_IED结合,就会这样做。 如果有的话,请。 该通知是人工发出的。

问题回答

暂无回答




相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签