Nyh

• ActivityMain f fii^ Button, ){- Button MtiL J ¥ tf. iliin/r^(OnClickListener),

VIM/Üffit Button motte. Activity.

'IMrSfi Button ¡3, ActivityMainNotification Afrff -"K^SMtWs package com . eoeAndroid. toast, and notification;

impor t. Android, app.Activity; import Android.app.Noti f ication; import Android, app.Noti f icat -..onManager ; import Android.app.Pendinclntent; import Android. content.. Intent; import Android.os.Bundle; import Android.view.View; import. Androi d . widget. Button;

public class ActivityMainNotification extends Activity {

private static int NOTIFICATIONS ID = R. layout.. act 1 vi t y_not if icat ion;

private NotificationManager ir.Not if icat ionManager ;

(¿Override public void onCreate(Bundle savedlnstanceState) ( super.onCreate(savedlnstanceState); setContentView(R.layout.activity_notification);

Button button;

rr.Noti t icat ionManager (Notif icationManager) getSystemService (N0TIFI CAT ION SERVICE);

button .setOnClickListener(new Button.OnClickListener() I

public void onCiick(View v) {

setWeather("8i£73?g», "^EiJS", 't^f", R.drawable.sun);

Was this article helpful?

0 0

Post a comment