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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:41:22+00:00 2026-05-28T13:41:22+00:00

I have the following code, with which I am trying to create a seperated

  • 0

I have the following code, with which I am trying to create a seperated list by using this class.

I have this:

public Map<String, ?> createItem(String title, String caption, String uri) {
        Map<String, String> item = new HashMap<String, String>();
        item.put(ITEM_TITLE, title);
        item.put(ITEM_CAPTION, caption);
        item.put(ITEM_URI, uri );
        return item;
    }

public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        /** @todo Draw the splash screen */
        setContentView(R.layout.list_complex);
        List<Map<String,?>> security = new LinkedList<Map<String,?>>();
        security.add(createItem("Remember passwords", "Save usernames and passwords for Web sites","uri"));
        security.add(createItem("Clear passwords", "Save usernames and passwords for Web sites","uri2"));
        security.add(createItem("Show security warnings", "Show warning if there is a problem with a site's security","uri3"));

SeparatedListAdapter adapter = new SeparatedListAdapter(this);
        adapter.addSection("Security", new SimpleAdapter(this, security, R.layout.list_complex,
            new String[] { ITEM_TITLE, ITEM_CAPTION}, new int[] { R.id.list_complex_title, R.id.list_complex_caption }));

        ListView list = new ListView(this);

        list.setOnItemClickListener(new OnItemClickListener() {
              public void onItemClick(AdapterView<?> parent, View view,
                      int position, long id) {
                 try{
                      Log.v(TAG, "Pressed id: "+(parent.getItemAtPosition(position).getClass()));
                 }catch(Exception e){
                     Log.v(TAG, "Field not found: "+e.getCause()+" : "+e.getMessage());
                 }
//Log.v(TAG, "Pressed id: "+parent.);
                  //  Intent newActivity = new Intent(view.getContext(),agones.class);     
                        //     startActivity(newActivity);

                  }
                });
        list.setAdapter(adapter);
        this.setContentView(list);

What I’m trying to do here is to get the field uri from the HashMap. If I log this out, it tells me that the class is of the instance HashMap, but when I try to use the method .get() on it, Eclipse says this:

The method get() is undefined for the type Class<capture#5-of ? extends Object>

How do I go about fixing this? I’m sorry if this is simple, but since I’m new, I cant wrap my head around this.

  • 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-28T13:41:23+00:00Added an answer on May 28, 2026 at 1:41 pm

    This has to do with Capture Conversion.

    On your createItem method, you’re returning a HashMap<String, String> and expect Java to bind it to Map<String, ?>.

    This results in the JVM unbounding your String to an unknown type ?. thus, when you do Map<String, ?>.get(), it doesn’t know how to bind an unknown type ? to a type T.

    My suggestion is to return a Map<String, String> on createItem(), and

    List<Map<String,?>> security = new LinkedList<Map<String,?>>();
    

    into

    List<Map<String, String>> security = new LinkedList<Map<String, String>>();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code in which I'm trying to serialize a list to
I'm trying to use opengl in C#. I have following code which fails with
I am trying to use the following code, which I have not been able
I have the following code, where i am trying to create a generic collection
I have implement the following code to create a SSL server socket. public void
I have the following code: private lazy val keys: List[String] = obj.getKeys().asScala.toList obj.getKeys returns
I have following Code Block Which I tried to optimize in the Optimized section
I have the following code which works just fine when the method is POST,
I have the following code which works fine. However, I only want to return
I have the following code which should put programs startable in Bash. if [

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.