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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:27:33+00:00 2026-05-22T11:27:33+00:00

I’m creating a ListActivity that has only images in the rows. I can display

  • 0

I’m creating a ListActivity that has only images in the rows. I can display the images already but when I try to click on the row it does nothing. I can click on the image that I’ve added but I would like to be able to click on the whole row like a normal List Activity. Can anyone tell me how I can do that? Not sure why the code backtick isn’t picking up my first line but here it is:

Still haven’t been able to solve this problem. Anyone?

public class AddNote extends ListActivity {

IconAdapter mAdapter;
private Button btnMove;
private Button btnDelete;
private Button btnSave;
private EditText etDescription;
private int iconPos = 0;
private String server;
private String project;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    final SharedPreferences app_preferences = PreferenceManager.getDefaultSharedPreferences(this);
    final SharedPreferences.Editor editor = app_preferences.edit();
    setContentView(R.layout.add_note);
    mAdapter = new IconAdapter(this);
    setListAdapter(mAdapter);
    mAdapter.addIcons();
    btnMove = (Button) findViewById(R.id.move);
    btnDelete = (Button) findViewById(R.id.delete);
    btnSave = (Button) findViewById(R.id.save);
    etDescription = (EditText) findViewById(R.id.description);
    server = app_preferences.getString("server", "none");
    project = app_preferences.getString("project", "no project");

    btnMove.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            Log.e("Move", "Move");
        }
    });

    btnDelete.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            Log.e("Delete", "Delete");
        }
    });

    btnSave.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            if (etDescription.getText().toString().trim().equals(""))
                Toast.makeText(getApplicationContext(), "Please enter a description", Toast.LENGTH_SHORT).show();
            else
            {
                UUID id = UUID.randomUUID();
                saveMapIcon(id, iconPos, etDescription.getText().toString(), "0,0");
            }
        }
    });
}

@Override
protected void onListItemClick(ListView l, View v, int position, long id)
{
    super.onListItemClick(l, v, position, id);
    Log.e("Test", "testing....");
    iconPos = position;
}

private void saveMapIcon(UUID theID, int position, String description, String location)
{
    SharedPreferences app_preferences = PreferenceManager.getDefaultSharedPreferences(this);
    SharedPreferences.Editor editor = app_preferences.edit();

    String mapIcons = app_preferences.getString("mapNotes", "none");
    if (mapIcons.equals("none"))
    {
        mapIcons = server + "|" + project + "|" + theID + "|" + position + "|" + description + "|" + location + "*";
    }
    else
    {
        mapIcons += server + "|" + project + "|" + theID + "|" + position + "|" + description + "|" + location + "*";
    }
    Log.e("position:", String.valueOf(position));
    editor.putString("idToMove", theID.toString() + "|" + String.valueOf(position));
    editor.putString("mapNotes", mapIcons);
    editor.putBoolean("addingIcon", true);
    editor.commit();
    Log.e("Test", mapIcons);

    Intent intent = null;
    intent = new Intent(getApplicationContext(), GetMap.class);
    intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    startActivity(intent);
}

public class IconAdapter extends BaseAdapter {
    private Context mContext;
    ArrayList<View> imageViews = new ArrayList<View>();

    private Integer[] mIconList = {
            R.drawable.symbol1, R.drawable.symbol2, R.drawable.symbol3, R.drawable.symbol4, R.drawable.symbol5};

    private ArrayList<Integer> mIcons = new ArrayList<Integer>();

    public IconAdapter(Context c) {
        mContext = c;
    }

    public int getCount() {
        return mIconList.length;
    }

    public Object getItem(int position) {
        return mIconList[position];
    }

    public long getItemId(int position) {
        return position;
    }

    public View getView(int position, View convertView, ViewGroup parent) {
        ImageView i = new ImageView(mContext);
        i.setImageResource(mIcons.get(position));

        return i;
    }

    public void addIcons() {        
        for (int i=0; i<mIconList.length; i++)
        {
            mIcons.add(mIconList[i]);
        }
        notifyDataSetChanged();
    }
}

}

  • 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-05-22T11:27:34+00:00Added an answer on May 22, 2026 at 11:27 am

    I ended up making a holder in the getView() of my ArrayAdapter and loading it with an ImageView. I also put it in an AlertDialog because I suspect it may have been having problems with trying to have a list as well as other gui elements on the screen at the same time.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
In my XML file chapters tag has more chapter tag.i need to display chapters
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has

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.