开发者

Service notification open main activity

Ok, I am working on an Android app that uses a service to collect & process GPS data. The service also creates a notificati开发者_如何学Goon in the status bar. What I cannot figure out is how to have the notification open the main class when a user clicks on it. From what I've found online it shouldn't be that hard to do, but I cannot get it to work. Does anyone have some suggestions on where to look?


Intent notificationIntent = new Intent(this, MyClass.class);

This line of code is from http://developer.android.com/guide/topics/ui/notifiers/notifications.html.

Simply replace MyClass with your activity class - it will be launched when you click the notification.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜