是否可以在GridView中使用Fragments?
我试过这样做:
@Override
public View getView(int position, View convertView, ViewGroup parent)
{
if(convertView == null)
{
Rune rune = (Rune) getItem(position);
RuneFragment runeFragment = new RuneFragment();
FragmentTransaction transaction = activity.getSupportFragmentManager().beginTransaction();
transaction.add(parent.getId(), runeFragment);
transaction.commit();
runeFragment.renderRune(rune);
convertView = parent.findViewById(R.id.rune_grid_fragment);
Log.i(MainActivity.TAG, "" + convertView); //====> null
}
return convertView;
}
但结果是convertView始终为null。
答案 0 :(得分:0)
你可以这样做。
SELECT * FROM jobs WHERE jobno < 2016000