jjzjj

android - 在 onDestory() 中停止/释放 Mediaplayer 会导致 NullPointerException

我试图在onDestroy()中停止并释放一个MediaPlayer对象,但应用程序一直崩溃。这是代码:voidStartSound(finalStringReaderPath){mediaplayer=MediaPlayer.create(test2.this,Uri.parse(ReaderPath));try{mediaplayer.start();mediaplayer.setOnCompletionListener(newOnCompletionListener(){@OverridepublicvoidonCompletion(MediaPlayermp){current+

java - 命令失败,错误 16410 : 'FieldPath field names may not start with ' $'.'

我曾尝试在互联网上搜索有关此错误的信息,但无济于事。我正在尝试使用Java在mongodb中使用aggregate函数。RetailerZip是我要对结果进行分组的字段。groupFields=newBasicDBObject("_id",0);groupFields.put("count",newBasicDBObject("$sum",1));groupFields.put("_id","$RetailerZip");group=newBasicDBObject("$group",groupFields);sort=newBasicDBObject();projectFields=