Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Finally I´ve put it to work.</p> <p>Well, first you need to correct the call from <code>PagerAdapter</code>.</p> <pre><code>public Fragment getItem(int position) { Fragment fragment = new FragmentListArraySupport.ArrayListFragment(); // set arguments here, if required Bundle args = new Bundle(); fragment.setArguments(args); return fragment; </code></pre> <p>The <code>FragmentListArraySupport</code> is the <code>FragmentActivity</code> and <code>ArrayListFragment</code> is the <code>ListFragment</code>.</p> <p>This is the <code>FragmentListArraySupport</code> code:</p> <pre><code> public class FragmentListArraySupport extends FragmentActivity { @Override protected void onCreate(Bundle savedInstanceState) { setTheme(SampleList.THEME); //Used for theme switching in samples super.onCreate(savedInstanceState); // Create the list fragment and add it as our sole content. if (getSupportFragmentManager().findFragmentById(android.R.id.content) == null) { ArrayListFragment list = new ArrayListFragment(); getSupportFragmentManager().beginTransaction().add(android.R.id.content, list).commit(); } } public static class ArrayListFragment extends ListFragment { @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); ImageDownloader.Mode mode = ImageDownloader.Mode.CORRECT; ImageAdapter imageAdapter = new ImageAdapter(); imageAdapter.getImageDownloader().setMode(mode); setListAdapter(imageAdapter); } @Override public void onListItemClick(ListView l, View v, int position, long id) { Log.i("FragmentList", "Item clicked: " + id); } } } </code></pre> <p>See that you need to change <code>ListActivity</code> to <code>FragmentActivity</code> Now you have your image adapter working, so whatever <code>ListArrayAdapter</code> that you found around internet you just need to copy the class files, call the ArraySupport in the <code>PagerAdapter</code> and change the <code>ListActivity</code> to <code>FragmentActivity</code>.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload