Çalışmıyor: http://developer.android.com/training/implementing-navigation/ancestral.htmlAndroid Yukarı Navigasyon ben uygun navigasyon uygulamaya çalışıyorum
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
// Respond to the action bar's Up/Home button
case android.R.id.home:
Intent upIntent = NavUtils.getParentActivityIntent(this);
if (NavUtils.shouldUpRecreateTask(this, upIntent)) {
// This activity is NOT part of this app's task, so create a new task
// when navigating up, with a synthesized back stack.
TaskStackBuilder.create(this)
// Add all of this activity's parents to the back stack
.addNextIntentWithParentStack(upIntent)
// Navigate up to the closest parent
.startActivities();
} else {
// This activity is part of this app's task, so simply
// navigate up to the logical parent activity.
NavUtils.navigateUpTo(this, upIntent);
}
return true;
}
return super.onOptionsItemSelected(item);
}
ama if (NavUtils.shouldUpRecreateTask(this, upIntent)) {
hep YANLIŞ dönüyor.
Bu kod nasıl kullanılır? Hangi durumlarda doğrudur? öncesi Jelly Bean cihazlarda
Örneğin, Ana Sayfa düğmesine bastığımda, etrafında gezinip görev yöneticisi ile uygulamama geri dönersem, bu öğe hala yanlıştır, daha fazla görev yığını olmasa bile (bu benim ana etkinliğimi değil Görev yöneticisine geri götürür) . – Dandy