当android.resource://具有该资源的Uri时,如何调试该资源是否存在

当android.resource://具有该资源的Uri时,如何调试该资源是否存在,android,android-studio,push-notification,android-resources,Android,Android Studio,Push Notification,Android Resources,我正在使用Android studio制作推送通知,我的手机通过USB插入,作为调试设备,通知通过精细的自定义文本集等发送。但是,当我尝试使用 Uri defaultSoundUri = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.alarm); 然后计算为android。resource://gcm.play.android.samples.com.gcmquickstart/2131099648它不打球

我正在使用Android studio制作推送通知,我的手机通过USB插入,作为调试设备,通知通过精细的自定义文本集等发送。但是,当我尝试使用

Uri defaultSoundUri = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.alarm);
然后计算为
android。resource://gcm.play.android.samples.com.gcmquickstart/2131099648
它不打球

我的猜测是声音文件不在那里,它只是默默地失败

代码:

private void sendNotification(String message) {
    Intent intent = new Intent(this, MainActivity.class);
    intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    PendingIntent pendingIntent = PendingIntent.getActivity(this, 0 /* Request code */, intent,
            PendingIntent.FLAG_ONE_SHOT);

    Uri defaultSoundUri = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.alarm);
    // RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
    NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)
            .setSmallIcon(R.drawable.ic_stat_ic_notification)
            .setContentTitle(message)
            .setContentText(message)
            .setAutoCancel(true)
            .setSound(defaultSoundUri)
            .setContentIntent(pendingIntent);

    NotificationManager notificationManager =
            (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);

    notificationManager.notify(0 /* ID of notification */, notificationBuilder.build());
}

我如何调试应用程序,通过Url我可以确认资源是否存在?

顺便说一句,我很愚蠢-我在手机上发出声音:)仍然存在疑问。