I am creating an application which fetches movies list from Tmdb Api. My code is for main Activity is
public class MainActivityFragment extends Fragment {
public class FetchImageTask extends AsyncTask<...>{
//
}
}
And I have another adapter class
public class MovieAdapter extends ArrayAdapter<MovieImage> {
private static int page_nmber = 1;
public MovieAdapter(Context context, List<MovieImage> objects) {
super(context, 0 , objects);
}
final String LOG_TAG = MovieAdapter.class.getSimpleName();
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if(getCount() == position + 5 ){
//Log.v(LOG_TAG, " last two images");
}
MovieImage movieImage = getItem(position);
View rootView = LayoutInflater.from(getContext())
.inflate(R.layout.list_item_movie, parent, false);
ImageView imageView = (ImageView) rootView.findViewById(R.id.list_item_movie_image);
Picasso.with(getContext()).load(movieImage.getImage_path())
.placeholder(R.drawable.loading)
.fit()
.into(imageView);
return rootView;
}
public void fetchExtraImages(){
MainActivityFragment.FetchImageTask fetchImageTask;
fetchImageTask = new MainActivityFragment.FetchImageTask();
//Gives me error saying this is not an enclosing class
}
Actually I want to create another object for FetchImageTask object and call next page(page 2) results and append result to respective adapter.
Any help is appreciated. :)