how to show notification

protected void sendnotification (String title, String message,int Icon) {
String ns = Context.NOTIFICATION_SERVICE;
NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);

int icon = Icon;
CharSequence tickerText = message;
long when = System.currentTimeMillis();

Notification notification = new Notification(icon, tickerText, when);

Context context = getApplicationContext();
CharSequence contentTitle = title;
CharSequence contentText = message;
Intent notificationIntent = new Intent(this, Midlet.class);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);

notification.flags = Notification.FLAG_AUTO_CANCEL;
notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);
mNotificationManager.notify(1, notification);
}

### UML Use Case Diagram Include vs Extend Difference and Usage Scenario In the context of Unified Modeling Language (UML), both `<<include>>` and `<<extend>>` relationships are used to show dependencies between use cases but serve different purposes. #### Understanding <<include>> The `<<include>>` relationship indicates that one use case includes or contains another. This means part of a use case's behavior can be factored out into a separate, reusable piece represented by an included use case. The including use case cannot function without this inclusion; it relies on the functionality provided by the included use case[^1]. For instance, consider a banking system where logging in is necessary before performing any transactions like withdrawing money or transferring funds. Here, "Log In" would be an included use case because these actions depend upon successful authentication through login. ```plantuml @startuml actor User User --> (Withdraw Money) (User) .> (Log In) : <<include>> @enduml ``` #### Exploring <<extend>> Conversely, the `<<extend>>` relation signifies optional extensions to base behaviors defined within primary use cases. An extending use case adds new functionalities under certain conditions while not altering core operations when those criteria aren't met[^2]. Imagine again our bank application scenario extended further so users could receive notifications about their account balance after completing withdrawals only if they opted-in previously for such alerts. Thus, "Receive Notification" extends "Withdraw Money". ```plantuml @startuml actor User User --> (Withdraw Money) (Withdraw Money) ..> (Receive Notification) : <<extend>> @enduml ``` By distinguishing between mandatory (`<<include>>`) versus conditional additions (`<<extend>>`), developers gain clearer insights into how systems should operate logically during design phases involving analysis modeling and design tasks conducted possibly concurrently with each other[^3]. --related questions-- 1. How does incorporating `<<include>>` impact overall software architecture? 2. Can multiple use cases simultaneously extend a single main use case? What implications arise from doing so? 3. Are there scenarios better suited specifically towards using either `<<include>>` over `<<extend>>`, or vice versa? 4. When designing complex applications integrating various business processes, what considerations come into play regarding real-life knowledge management solutions' integration capabilities mentioned earlier[^4]?
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值