首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网络技术 > 网络基础 >

Noticicaition的应用及发起一个包名程序

2012-08-22 
Noticicaition的使用及发起一个包名程序Intent i new Intent() i.setClassName(com.sygic.drive,com

Noticicaition的使用及发起一个包名程序

Intent i = new Intent(); i.setClassName("com.sygic.drive","com.sygic.drive.SygicDriveActivity"); startActivity(i);

?

Notification notification = new Notification(     android.R.drawable.stat_sys_warning,  //Icon to use     "Hello World!", //Text     System.currentTimeMillis() //When to display - i.e. now );  //Create a PendingIntent to do something when the user clicks on the Notification //Normally this would be something in your own app Intent intent = new Intent(); intent.setAction(Intent.ACTION_VIEW); intent.setData(Uri.parse("http://www.stackoverflow.com")); PendingIntent pi = PendingIntent.getActivity(this, 0, intent, 0);  //Add the detail to the Notification notification.setLatestEventInfo(     getApplicationContext(),     "Stack Overflow", //Title of detail view     "This will launch Stack Overflow",  //Text on detail view     pi );  //Display the Notification NotificationManager nm = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE); nm.notify(ID_HELLO_WORLD, notification);  //ID_HELLO_WORLD is a int ID 

?

热点排行