我成功地获得了GCM推送通知.现在我想添加自定义声音文件而不是默认声音.我曾尝试与乌里从
文件:///res/raw/pop.mp3
在
Notification.DEFAULT_SOUND;
但没有成功.如果您有更好的解决方案,请分享.
我的GCMIntentService.java方法代码如下 -
/**
* Issues a notification to inform the user that server has sent a message.
*/
private static void generateNotification(Context context, String message) {
System.out.println("Called generateNotification>>>>>>>>>>>>>"+message);
NotificationManager notificationManager = (NotificationManager) context
.getSystemService(Context.NOTIFICATION_SERVICE);
// Notification notification = new Notification(icon, message, when);
String title = context.getString(R.string.app_name);
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(
context)
.setSmallIcon(R.drawable.app_icon)
.setContentTitle(title)
.setStyle(
new NotificationCompat.BigTextStyle().bigText(message))
.setContentText(message);
Intent notificationIntent = new Intent(context,
SplashActivity.class);
PendingIntent intent = PendingIntent.getActivity(context, 0,
notificationIntent, PendingIntent.FLAG_CANCEL_CURRENT); …Run Code Online (Sandbox Code Playgroud) 我想在TextView中打印一个双号,就像这种格式10699657.6,目前这就像1.06996576E7.请任何人帮帮我吗?
可能重复:
有没有人知道一个好的JSON时间服务器?
服务器上是否有公共json或xml现在我可以解析当前时间?我将利用这段时间检查我的应用程序的试用版本的到期时间,我没有使用日历或日期类.我是Android新手.谢谢.