Ну, это было отличное начало разработки приложений для Android.
Но вот что-то новое, что произошло сейчас!
После того как пользователь не проявляет активности, приложение становится forceclosed операционной системы
Что-то, что он славится ...
Теперь это происходит только с этим экраном п не Основной экран Активности
Я использовал ListView для этой активности в плейлисте
Теперь - я хочу разрешить симуляцию экрана, n не отключать его, сохраняя приложение в памяти! 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();
}
}
показать нам свой код и ошибку –
нет ошибки как таковой n хорошо работает приложение, если и до тех пор, пока экран не зажжется! похоже, какая-то программа для повышения эффективности памяти, но все равно загружаю подставку! – user2160540
Проводка логарифма из разбитого хода также будет полезна – Chilledrat