Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7721841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:01:51+00:00 2026-06-01T04:01:51+00:00

i created one grid view application, it’s working fine now showing all images in

  • 0

i created one grid view application, it’s working fine now showing all images in grid view. now i am trying to display selected image in full screen, but i am getting error. my grid view images are downloaded in url link. my url link are stored in array list. how to solve this error?
error class name is FullImageActivity.class

error: imageAdapter1.GridViewConfig cannot be resolved or is not a field

error line :

imageView.setImageResource(imageAdapter1.GridViewConfig.getResim_list().get(position));  

this is my coding:

public class FullImageActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.full_image);

        // get intent data
        Intent i = getIntent();

        // Selected image id
        int position = i.getExtras().getInt("id");
        ImageAdapter imageAdapter1 = new ImageAdapter(this);

        ImageView imageView = (ImageView) findViewById(R.id.full_image_view);
        imageView.setImageResource(imageAdapter1.GridViewConfig.getResim_list().get(position));
    }

}

ImageAdapter.class

public class ImageAdapter extends BaseAdapter implements ListAdapter {


    private Context context;
    public ImageAdapter(Context context) {
        super();
        this.context = context;
        //Listeye image url si ekliyor
        GridViewConfig.addImageUrls();
    }


    @Override
    public int getCount() {
        return GridViewConfig.getResim_list().size();
    }

    @Override
    public Object getItem(int position) {

        return GridViewConfig.getResim_list().get(position);
    }

    @Override
    public long getItemId(int position) {

        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ImageView imageView;
        if(convertView==null)
        {
            imageView=new ImageView(context.getApplicationContext());
            //imageView.setImageURI(Uri.withAppendedPath(MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI, ""+ id));
            imageView.setLayoutParams(new GridView.LayoutParams(100,100));
            imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
            imageView.setPadding(5,5,5,5);
        }else{
            imageView=(ImageView)convertView;
        }
        imageView.setImageDrawable(LoadImageFromURL(GridViewConfig.getResim_list().get(position)));
        return imageView;
    }

//Internetten imageleri stream olarak  cekip drawable olsurturuyor.
    private Drawable LoadImageFromURL(String url)
    {
    try
    {
    InputStream is = (InputStream) new URL(url).getContent();
    Drawable d = Drawable.createFromStream(is, "src");
    return d;
    }catch (Exception e) {
    System.out.println(e);
    return null;
    }
    }

}

GridViewconfig.class

public class GridViewConfig {
    private static ArrayList<String> resim_list=new ArrayList<String>();
    public static int[] getResim_list;

    public static ArrayList<String> getResim_list() {
        return resim_list;
    }

    public static void setResim_list(ArrayList<String> resim_list) {
        GridViewConfig.resim_list = resim_list;
    }

    public static void addImageUrls(){
        resim_list.add("http://igen.com/Images/Home/Client-Logo.png");


    }
}

MyGridView.class

public class MyGridView extends Activity {
    private GridView girGridView;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        girGridView=(GridView) findViewById(R.id.gridView1_bir);
//ListView gibi buna da adapter set ediliyor.
        girGridView.setAdapter(new ImageAdapter(getApplicationContext()));

        girGridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {

            @Override
            public void onItemClick(AdapterView<?> arg0, View view, int position,long arg3) {

                  // Sending image id to FullScreenActivity
                Intent i = new Intent(getApplicationContext(), FullImageActivity.class);
                // passing array index
                i.putExtra("id", position);
                startActivity(i);
    }
        });
    }
}

I posted my full source code…..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T04:01:53+00:00Added an answer on June 1, 2026 at 4:01 am

    First of all: GridViewConfig indeed is not a field of your ImageAdapter.

    Second:
    imageView.setImageResource(imageAdapter1.GridViewConfig.getResim_list().get(position));

    it will not work: getResim_list() returns ArrayList, it contains String values NOT int

    You can try change :

    public class FullImageActivity extends Activity {
    
       @Override
       public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.full_image);
    
           // get intent data
           Intent i = getIntent();
    
           // Selected image id
           int position = i.getExtras().getInt("id");
           ImageView imageView = (ImageView) findViewById(R.id.full_image_view);
           GridViewConfig.addImageUrls();
           imageView.setImageDravable(LoadImageFromURL(GridViewConfig.getResim_list().get(position)));
        }
    
        private Drawable LoadImageFromURL(String url) {
            ....
        }
    
    }
    

    But in my opinion you should rewrite all your code. The main problem: the drawings must be loaded in a separate thread.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I created one grid view application. it's display my sdcard images in my
hello i have created one windows application in c# .net and its working fine
I created one application to read all the contacts stored in android 2.0 emulator.I
I am using data grid view in Windows Form standalone application to display items
hi I created one simple xml based spinner application.i got all value in my
I created one Windows application for displaying Gmail conversations in a datagrid. All are
I have created one application in flex that is accessing the Java webservice using
As need to display Records in grid view in (ASP.NET) web site. and for
I use the MFC list control in report view with grid lines to display
I created one application called wallpaper in this apps I am browsing Image using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.