Тайм-аут отправки ввода - PullRequest
0 голосов
/ 26 марта 2019

У меня есть приложение музыкального проигрывателя, которое выдает следующую ошибку

 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, я получилошибка от ANRs & вылетает.

...