本文整理汇总了Java中android.support.v17.leanback.widget.ObjectAdapter.get方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectAdapter.get方法的具体用法?Java ObjectAdapter.get怎么用?Java ObjectAdapter.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v17.leanback.widget.ObjectAdapter
的用法示例。
在下文中一共展示了ObjectAdapter.get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: IconListRow
import android.support.v17.leanback.widget.ObjectAdapter; //导入方法依赖的package包/类
public IconListRow(long id, HeaderItem headerItem, ObjectAdapter adapter) {
super(id, headerItem, adapter);
// Make sure the adapter contain only Icon objects
for (int i=0; i<adapter.size(); i++) {
Object o = adapter.get(i);
if ( !(adapter.get(i) instanceof Icon) ) {
throw new IllegalArgumentException("IconListRow must contain only Icon objects! not this: "+adapter.get(i));
}
}
}
示例2: onLoadFinished
import android.support.v17.leanback.widget.ObjectAdapter; //导入方法依赖的package包/类
@Override
public void onLoadFinished(Loader<Cursor> loader, Cursor cursor) {
int id = loader.getId();
ObjectAdapter adapter = getAdapter();
ListRow row = (ListRow) adapter.get(id);
CursorObjectAdapter rowAdapter = (CursorObjectAdapter) row
.getAdapter();
rowAdapter.swapCursor(cursor);
}
示例3: onLoaderReset
import android.support.v17.leanback.widget.ObjectAdapter; //导入方法依赖的package包/类
@Override
public void onLoaderReset(Loader<Cursor> loader) {
// This is called when the last Cursor provided to
// onLoadFinished()
// above is about to be closed. We need to make sure we are no
// longer using it.
int id = loader.getId();
ObjectAdapter adapter = getAdapter();
ListRow row = (ListRow) adapter.get(id);
CursorObjectAdapter rowAdapter = (CursorObjectAdapter) row
.getAdapter();
rowAdapter.swapCursor(null);
}