1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2026-04-22 06:41:22 +00:00

fixed inefficient double-conversion of parceled VideoInfoItems, from being cast from VideoInfoItem[] to Vector<>, to using ArrayList as an implementation of List

This commit is contained in:
Adam Howard
2015-11-13 10:47:05 +00:00
parent f13f9a066a
commit cc7ce5cf93
5 changed files with 12 additions and 10 deletions

View File

@@ -16,6 +16,7 @@ import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.ImageView;
import java.util.ArrayList;
import java.util.Arrays;
/**
@@ -114,13 +115,13 @@ public class VideoItemListActivity extends AppCompatActivity
Bundle arguments = getIntent().getExtras();
if(arguments != null) {
Parcelable[] p = arguments.getParcelableArray(VIDEO_INFO_ITEMS);
//Parcelable[] p = arguments.getParcelableArray(VIDEO_INFO_ITEMS);
ArrayList<VideoInfoItem> p = arguments.getParcelableArrayList(VIDEO_INFO_ITEMS);
if(p != null) {
mode = PRESENT_VIDEOS_MODE;
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
//todo: make this more efficient
listFragment.present(Arrays.copyOf(p, p.length, VideoInfoItem[].class));
listFragment.present(p);
}
}