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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:01:06+00:00 2026-06-03T00:01:06+00:00

Hi all I have custom grid view with imageButton and textView as follows Here

  • 0

Hi all I have custom grid view with imageButton and textView as follows

enter image description here

Here i have used imageButton.. The problem is the grid is not clickable.. But if i use here imageView it works fine but UI is not appropriate.

Here is my layout

 <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" 
    android:gravity="center"
    android:padding="5dp"
    >

    <ImageButton
        android:id="@+id/profilePic"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/newlocation" 
        android:background="@drawable/btnbackground"
        />

    <TextView
        android:id="@+id/SpeakerName"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:textSize="15sp"
        android:text="Some Speaker"
        />

Here is my adapter

    package com.tt.cc;

import java.util.List;

import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class SavedConferencesGridAdapter extends ArrayAdapter<String>{


    Context mContext;
    List<String> confernceList;

    public SavedConferencesGridAdapter(Context context, int textViewResourceId, List<String> confernceList) 
    {

        super(context,textViewResourceId,confernceList);
        this.confernceList =  confernceList;
        this.mContext = context;
        Log.e("TAG", confernceList.size()+"");
    }

    int[] picIds = new int[] { R.drawable.newschedule,R.drawable.newexhibitors,
                                R.drawable.newsponsers, R.drawable.newlocation,
                                R.drawable.newfavourites, R.drawable.newreminder,R.drawable.info,R.drawable.info,R.drawable.info,R.drawable.info,R.drawable.info,R.drawable.info };


    @Override
    public int getCount() {
        // TODO Auto-generated method stub
        return confernceList.size();
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        // TODO Auto-generated method stub
        View v;



        if(convertView==null){
            LayoutInflater li = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            v = li.inflate(R.layout.entity, null);
            TextView tv = (TextView)v.findViewById(R.id.SpeakerName);
            tv.setText("tt");
            /*ImageView iv = (ImageView) v.findViewById(R.id.profilePic);
            iv.setImageResource(picIds[position]);*/

        }
        else
        {
            v = convertView;
        }
        return v;
    }



}

and here is my activity

 public class SavedConferencesActivity extends Activity{

    GridView confereneceGridView;
    ArrayAdapter<String> conferneceAdapter;
    Button btnUpdate;

    List<String> conferenceList;
    TextView txtHeading;
    Boolean result = false;

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);


    }


    protected void onStart() {
        super.onStart();
        setContentView(R.layout.homegridlayout);
        initialize();

        confereneceGridView.setOnItemClickListener(new OnItemClickListener() {

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

                Toast.makeText(SavedConferencesActivity.this, conferenceList.get(position)+"", Toast.LENGTH_SHORT).show();


    }

    @Override
    protected void onResume() {
        // TODO Auto-generated method stub
        super.onResume();

        conferneceAdapter = new SavedConferencesGridAdapter(this, android.R.layout.simple_list_item_1, conferenceList);
        confereneceGridView.setAdapter(conferneceAdapter);
    }


    private void initialize() {


        confereneceGridView = (GridView) findViewById(R.id.gridOfConference);
        btnUpdate = (Button) findViewById(R.id.btnUpdate);
        txtHeading = (TextView) findViewById(R.id.txtTag);

        conferenceList = new ArrayList<String>();
        conferenceList.add("AA");
        conferenceList.add("BB");
        conferenceList.add("CC");

        if (conferenceList.size() == 0)
            txtHeading.setText("No conferences saved");
        else
            txtHeading.setText("Selected Conferences");



    }




}

Please help me in solving this problem. Or if any alternative available..

  • 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-03T00:01:08+00:00Added an answer on June 3, 2026 at 12:01 am

    Simple. Provide this attribute for the ImageButton ,

    android:focusable="false"
    

    This problem usually occurs when there is a focussable element in the Grid.(Eg:Buttons, ImageButton etc).

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

Sidebar

Related Questions

I have custom event that has several different subscribers who will all use the
I have a custom UIViewController subclass that handles all the view initialization by itself
I have created a custom theme for my activities that they all use. In
I have a list of custom colors that I use in all the UI
I have created custom MembershipUser, MembershipProvider and RolePrivoder classes. These all work and I
I have images placed in following path res>drawable>Images>Currencies>[All images] I have made a custom
I have created a simple Asp.Net custom control which automatically combines all the correct
I have 5 cells in a tableview that are all custom. Meaning, I've created
I have a Silverlight app with a DataGrid containing some custom columns and all
I have created a custom data grid control. I dragged it on windows form

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.