نمایش نتایج 1 تا 2 از 2

نام تاپیک: کدهای نوتیفیکشین بار جدید

  1. #1
    کاربر دائمی آواتار abbasalim
    تاریخ عضویت
    تیر 1391
    محل زندگی
    یزد ـ‌ اردکان
    پست
    1,039

    کدهای نوتیفیکشین بار جدید

    بنام خدا
    سلام


    جدیدا که کدهای نو تیف رو میزنم میگه این کدها منسوخ شده . میشه بگین کدهای جدید چیه؟




    package com.botskool.StatusBarNotification;
    ////نام پکیج شما
    import android.app.Activity;
    import android.app.Notification;
    import android.app.NotificationManager;
    import android.app.PendingIntent;
    import android.content.Context;
    import android.content.Intent;
    import android.os.Bundle;
    import android.view.View;
    import android.widget.Button;

    public class StatusBarNotificationActivity extends Activity {

    private static final int NOTIFICATION_ID = 1;

    @Override
    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);


    int icon = R.drawable.icon;

    CharSequence tickerText = "This is a sample notification";
    long when = System.currentTimeMillis();
    Context context = getApplicationContext();
    CharSequence contentTitle = "Sample notification";
    CharSequence contentText = "This notification has been generated as a result of button click.";
    Intent notificationIntent = new Intent(this, StatusBarNotificationActivity.class);
    PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);


    final Notification notification = new Notification(icon, tickerText, when);
    notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);


    String ns = Context.NOTIFICATION_SERVICE;
    final NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);

    Button statusbarnotify = (Button) findViewById(R.id.statusbarbutton);
    statusbarnotify.setOnClickListener(new View.OnClickListener() {
    public void onClick(View v) {
    mNotificationManager.notify(NOTIFICATION_ID, notification);
    }
    });
    }
    }


  2. #2
    کاربر دائمی
    تاریخ عضویت
    خرداد 1392
    پست
    179

    نقل قول: کدهای نوتیفیکشین بار جدید

    ----------
    آخرین ویرایش به وسیله hamyd_reza : سه شنبه 12 شهریور 1392 در 17:06 عصر

تاپیک های مشابه

  1. سوال: آیا همه کدهای جاوا اسکریپت در تمام مروگرهای جدید اجرا می شن؟
    نوشته شده توسط idocsidocs در بخش طراحی وب (Web Design)
    پاسخ: 4
    آخرین پست: جمعه 03 دی 1389, 21:05 عصر
  2. سوال: چگونگی ذخیره اتوماتیک بار کدهای اسکن شده ?
    نوشته شده توسط tabarestan در بخش بانک های اطلاعاتی در Delphi
    پاسخ: 6
    آخرین پست: سه شنبه 25 اسفند 1388, 17:22 عصر
  3. سوال: درخواست کدهای اسکرول بار
    نوشته شده توسط salibsatan در بخش C#‎‎
    پاسخ: 3
    آخرین پست: یک شنبه 12 آبان 1387, 11:04 صبح
  4. سوال: چرا بعضی وقتها کدهای پروژه asp.net دو بار اجرا میشوند؟
    نوشته شده توسط Mostafa_Sabeti در بخش ASP.NET Web Forms
    پاسخ: 7
    آخرین پست: پنج شنبه 17 مرداد 1387, 08:52 صبح
  5. و این بار با پدیده ای جدید : EXIS AntiTrojan 1.0
    نوشته شده توسط M8SPY_OK در بخش برنامه نویسی در 6 VB
    پاسخ: 17
    آخرین پست: چهارشنبه 28 شهریور 1386, 00:45 صبح

قوانین ایجاد تاپیک در تالار

  • شما نمی توانید تاپیک جدید ایجاد کنید
  • شما نمی توانید به تاپیک ها پاسخ دهید
  • شما نمی توانید ضمیمه ارسال کنید
  • شما نمی توانید پاسخ هایتان را ویرایش کنید
  •