javadi3d
پنج شنبه 08 اسفند 1392, 10:14 صبح
سلام
تو کد زیر به خوبی notification به خوبی اجرا میشود ولی وقتی روش کلیک میکنی باز هم هست و ناپدید نمیشه
چه چیزی به کد اضافه کنم تا پس از یک بار کلیک ناپدید بشه؟
سرچ کردم ولی چیزی دستگیرم نشد
ممنمون
public class Main extends Activity implements OnClickListener{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// notificatoin
NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
Notification notify = new Notification(R.drawable.nadealiicon, "سلام", System.currentTimeMillis());
Context context = Main.this;
CharSequence title = "از سایر محصولات ما دیدن فرمایید";
Intent intent = new Intent(context, Mahsulat.class);
PendingIntent pending = PendingIntent.getActivity(context, 0, intent, 0);
notify.setLatestEventInfo(context, title, details, pending);
nm.notify(0, notify);
//.....
تو کد زیر به خوبی notification به خوبی اجرا میشود ولی وقتی روش کلیک میکنی باز هم هست و ناپدید نمیشه
چه چیزی به کد اضافه کنم تا پس از یک بار کلیک ناپدید بشه؟
سرچ کردم ولی چیزی دستگیرم نشد
ممنمون
public class Main extends Activity implements OnClickListener{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// notificatoin
NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
Notification notify = new Notification(R.drawable.nadealiicon, "سلام", System.currentTimeMillis());
Context context = Main.this;
CharSequence title = "از سایر محصولات ما دیدن فرمایید";
Intent intent = new Intent(context, Mahsulat.class);
PendingIntent pending = PendingIntent.getActivity(context, 0, intent, 0);
notify.setLatestEventInfo(context, title, details, pending);
nm.notify(0, notify);
//.....