2013-08-10 2 views
-2

글쎄, 안드로이드 응용 프로그램 개발에 좋은 시작되었습니다.
하지만 지금은 새로운 일이 생겼습니다! 사용자 후

더 활동을 보여줍니다, 응용을위한 ...
이제이 만이 화면에 어떻게 N이 아닌 주요 활동 화면 OS에 의해이 유명


뭔가를 forceclosed지고
이 재생 목록 활동에 ListView를 사용했습니다.
Now - 화면 디밍을 허용하고 싶습니다. 사용하지 마세요! 메모리에 앱을 보관하는 동안! Plz은 어느 한 알 수있는 방법화면 밝기 조절 후 비정상적인 응용 프로그램 충돌이 발생했습니다.

protected void onCreate(Bundle savedInstanceState) 
{ 
    super.onCreate(savedInstanceState); 
    setContentView(R.layout.activity_playlist); 
    // Show the Up button in the action bar. 
    setupActionBar(); 
    ListView playlistView = (ListView)findViewById(R.string.playlistHolder); 
    String[] STAR = { "*" };   
     Uri allsongsuri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI; 
     String selection = MediaStore.Audio.Media.IS_MUSIC + " != 0"; 
     @SuppressWarnings("deprecation") 
     Cursor cursor = managedQuery(allsongsuri, STAR, selection, null, null); 
     File musicstorage = new File("assets/music.xml"); 
    // Create the array list of to do items 
      ArrayList<String> playItems = new ArrayList<String>(); 
      // Create the array adapter to bind the array to the listview 
      ArrayAdapter<String> aa; 
      aa = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,playItems); 
      // Bind the array adapter to the listview. 
      playlistView.setAdapter(aa); 
     if (cursor != null) 
     { 
      if (cursor.moveToFirst()) 
      { 
       do 
       { 
        String song_name = cursor.getString(cursor 
          .getColumnIndex(MediaStore.Audio.Media.DISPLAY_NAME)); 
        int song_id = cursor.getInt(cursor 
          .getColumnIndex(MediaStore.Audio.Media._ID)); 

        String fullpath = cursor.getString(cursor 
          .getColumnIndex(MediaStore.Audio.Media.DATA)); 

        String album_name = cursor.getString(cursor 
          .getColumnIndex(MediaStore.Audio.Media.ALBUM)); 
        int album_id = cursor.getInt(cursor 
          .getColumnIndex(MediaStore.Audio.Media.ALBUM_ID)); 

        String artist_name = cursor.getString(cursor 
          .getColumnIndex(MediaStore.Audio.Media.ARTIST)); 
        int artist_id = cursor.getInt(cursor 
          .getColumnIndex(MediaStore.Audio.Media.ARTIST_ID)); 
        playItems.add(0, song_name); 
        aa.notifyDataSetChanged(); 
       } while (cursor.moveToNext()); 
      } 
      cursor.close(); 
     } 
} 
+1

코드와 오류 –

+0

을 표시합니다. 화면이 켜지지 않는 한 앱이 잘 돌아갑니다. 오류가 없습니다. 일부 메모리 효율성 프로그램처럼 보이지만 여전히 코드 스탠드를 업로드 중입니다! – user2160540

+0

추락 한 실행에서 logcat을 게시하는 것도 도움이 될 것입니다. – Chilledrat

답변

관련 문제