输入调度超时光标

时间:2019-03-25 21:08:23

标签: android android-mediaplayer android-cursor android-contentresolver

我的音乐播放器应用出现以下错误

 Input dispatching timed out (Waiting because no window has focus but there is 
 a focused application that may eventually add a window when it finishes starting up.)

 The error is generated by this line of code 

 cursor = musicResolver.query(allSongsUri, projection, null, null, sortingOption+" "+sortingOrder); 

这是完整的代码

    Cursor cursor;
    ArrayList<Song> songList = new ArrayList<Song>();
    ContentResolver musicResolver = getActivity().getContentResolver();

    Uri allSongsUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
    final String[] projection = { MediaStore.Audio.Media.TITLE, MediaStore.Audio.Media.DATA, MediaStore.Audio.Media.DURATION,
            MediaStore.Audio.Media._ID, MediaStore.Audio.Media.ALBUM, MediaStore.Audio.Media.ARTIST, MediaStore.Audio.Media.ALBUM_ID};
    cursor = musicResolver.query(allSongsUri, projection, null, null, sortingOption+" "+sortingOrder);  //this is the line that generates the error.

我无法在Android手机上复制错误,我是从ANR和崩溃中获取错误的。

0 个答案:

没有答案