做个透明的Activity模拟对话框。
解决方案 »
- 自定义view的ANR问题
- 有两按钮共用一张背景图,修改其中一个半透明会相互影响
- Android解析gb2312编码的xml文件并显示
- 高分求助,android如何通过AT去拿到基站信息
- 如何封装HTML5文件直接在安卓上运行?
- Android SDK 4.0.3环境下EditText组建的显示问题
- android TextView问题
- 大神们帮忙啊。。。。android的地图方面的知识。急急急!!!!
- 新手求助。急急急
- 谁知道怎修改百度地图的弹出窗口怎么加入layout,标签能加吗?
- 如何查看Minimum Required SDK, Target SDK, Compile With这些设置?
- 困扰几周了,请教啊,android与websevice数据交互很诡异的问题
android:theme="@android:style/Theme.Dialog"
*
*/
public void createNotification(String content,String push_time) {
if(updateNotificationManager==null){
this.updateNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
}
if(updateNotification==null){
this.updateNotification = new Notification();
}
Intent notificationIntent=null;
PendingIntent contentIntent = null;
if(content!=null){
if(notificationIntent==null||contentIntent==null){
notificationIntent = new Intent(this, StartActivity.class); // 点击该通知后要跳转的Activity
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP
|Intent.FLAG_ACTIVITY_NEW_TASK);
contentIntent=PendingIntent.getActivity(this, 0,notificationIntent, 0);
}
updateNotification.icon = R.drawable.notification_icon;//设置通知栏的图标
updateNotification.tickerText = content;//设置通知栏内容
updateNotification.defaults |=Notification.DEFAULT_SOUND;//设置通知栏来通知的提示音
updateNotification.setLatestEventInfo(this,this.getResources().getString(R.string.software_name), content,contentIntent);
// 把Notification传递给NotificationManager
updateNotificationManager.notify(0, updateNotification);
// if(updateNotificationManager!=null){
// updateNotificationManager.cancelAll();
// }
}
}
在静态广播中无法显示dialog,报错