have a problem of using classes

Put your problem here if it does not fit any of the other categories.

have a problem of using classes

Postby Addion » Wed Dec 03, 2008 9:37 am

I can't call a method from mior class in main class. Below is my example.

public class WindowTest extends Activity {
/** Called when the activity is first created. */

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

a.notifyMe();


}

}

public class TestNotification extends Activity {


public void notifyMe() {

final NotificationManager mgr=
(NotificationManager)getSystemService(NOTIFICATION_SERVICE);
Notification note=new Notification(R.drawable.icon, " have signal",
System.currentTimeMillis());
PendingIntent i=PendingIntent.getActivity(this, 0,
new Intent(this, WindowTest.class),Intent.FLAG_ACTIVITY_NEW_TASK);
note.setLatestEventInfo(this, "Notification Title",
"This is the notification message", i);

note.flags = Notification.FLAG_AUTO_CANCEL;
mgr.notify(5, note);
}
}


Thanks in advance
Addion
Addion
Developer
Developer
 
Posts: 29
Joined: Tue Nov 18, 2008 3:49 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 20 guests