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 9029137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:10:41+00:00 2026-06-16T07:10:41+00:00

Instead of using images like in this example I found from Android Developer Site

  • 0

Instead of using images like in this example I found from Android Developer Site, I want to use edit texts in the gridView. What kind of adapter would I use? Do I even need an adapter?

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    GridView gridview = (GridView) findViewById(R.id.gridview);
    gridview.setAdapter(new ImageAdapter(this));

    gridview.setOnItemClickListener(new OnItemClickListener() {
        public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
            Toast.makeText(HelloGridView.this, "" + position, Toast.LENGTH_SHORT).show();
        }
    });
}

Ok, so i tried doing it, but its not working. It keeps crashing.

#imports….

public class MainActivity extends Activity{

    public void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_scout);

        GridView gridView = (GridView) findViewById(R.id.gridView);

        //final String[] letters = new String[]{"A", "B", "C", "D", "E", "F", "G", "H", "I"};

        //ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, letters);

        gridView.setAdapter(new ImageAdapter(this));

        gridView.setOnItemClickListener(new OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View v,
                    int position, long id) {
                Toast.makeText(getApplicationContext(), ((TextView) v).getText(), Toast.LENGTH_SHORT).show();
            }


        });

    }
}

ImageAdapter.java

//used for adding Edit texts to the grid view in the main activity
#imports....

public class ImageAdapter extends BaseAdapter{

    Context context;

    public ImageAdapter(Context context)
    {
        this.context = context;
    }


    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        View gridView;
        LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

        if(convertView == null)
        {
            gridView = new View(context);
            gridView = inflater.inflate(R.layout.grid_items, null);

            EditText editText = (EditText) gridView.findViewById(R.id.grid_item_edit_text);
        }
        gridView = (View)convertView;
        return gridView;
    }

    @Override
    public int getCount() {
        return 9;//only 9 pegs on the center rack
    }

    @Override
    public Object getItem(int position) {

        return null;
    }

    @Override
    public long getItemId(int position) {

        return 0;
    }


}
  • 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-16T07:10:42+00:00Added an answer on June 16, 2026 at 7:10 am

    You need a custom Gridview. In another word a Custom Adapter
    This tutorial will help you.

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

Sidebar

Related Questions

Instead of using an interface like this: public interface IStartable { void Start(); void
I am trying to implement kmeans clustering on images in openCV (using C). Instead
I am trying to save multiple image using this code. But instead its saving
Instead of using an external web-based Mercurial host, I want to set one up
instead of using getParameterByName('Field', PostData) (PostData == $('form').serialize();) I would like to write PostData.Field,
I am following the Android Gallery tutorial ( http://developer.android.com/guide/tutorials/views/hello-gallery.html ) but instead of simple
I am using something like this to share some text using available applications on
I currently use LWJGL Textures to draw images on the screen. I would like
Problem: Trying to use 'dynamic' variables to access JSON/JavaScript arrays. # EXAMPLE # Instead
Any idea how I can draw Bullet Points using Flex? instead of using image

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.