1

I have a listactivity where I read/set diferent controls such as textviews, buttons or listviews in OnCreate method and also I use diferents methods of this controls inside onCreate method. Now that I know that everything works well I would like to introduce a viewpager so I can fling between diferent layers.

I have read that I have to include my code into public Object instantiateItem of my pageadapter but there are some methods that are not recognised:

  1. setListAdapter
  2. getListView
  3. getResources
  4. getString
  5. When I use the list, I said that onCreate method, the context for the list was this. Now which context do I have to put?

How can they be recognised?

Akram
  • 7,548
  • 8
  • 45
  • 72
Learning from masters
  • 2,032
  • 3
  • 29
  • 42

1 Answers1

0
  1. setListAdapter
  2. getListView

    ListView listVi = (ListView) view.findViewById(R.id.list);
    listVi.setAdapter(adapter);
    
  3. getResources

    view.getResources()
    
  4. getString

    view.getResources().getString()
    
  5. When I use the list, I said that onCreate method, the context for the list was this. Now which context do I have to put?

    view.getContext();
    

PS. view is the View variable where I inflate the layer.

Learning from masters
  • 2,032
  • 3
  • 29
  • 42