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

The Archive Base Latest Questions

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

I have the following class define with some info that I would like to

  • 0

I have the following class define with some info that I would like to catch from another one. I used the context so getstring() can work:

public class Util{

public ArrayList<RecetaBean> getRellenas(Context con) {
ArrayList<RecetaBean> MiLista = new ArrayList<RecetaBean>();

RecetaBean receta1 = new RecetaBean();
String ingrediente1[] = {         con.getString(R.string.app_name), con.getString(R.string.app_name),
};
receta1.setIngredientesLista(ingrediente1);

MiLista.add(receta1);
MiLista.add(receta1);
MiLista.add(receta1);


return MiLista;

}

Then in another class extend activity I call to this class on the OnListItemClick() and works perfect. But in another class which charge a gridview instead of a list I use OnItemClicklistener() and doesn´t work, thats the code:

gridView.setOnItemClickListener(new OnItemClickListener() {        
    public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
        Util u = new Util();
        ArrayList<RecetaBean> Recetas = u.getRellenas();

The error is:

The method getRellenas(Context) in the type Util is not applicable for the arguments (new AdapterView.OnItemClickListener(){})

I don´t know how to implement that and fix it! Thanks!

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

    In your

    Utils.getRellenas(Context con)
    

    you expect a Context as parameter.
    I think it might be solved like this

    ArrayList<RecetaBean> Recetas = u.getRellenas(MyActivityName.this);
    

    Where you replace “MyActivityName” with the name of your containing activity.

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

Sidebar

Related Questions

I have the following class that maps some run loop calls from native code
I have the following class definition and for some reason I cannot define the
I have the following class #ifndef Container_H #define Container_H #include <iostream> using namespace std;
I have defined an Event class: Event and all the following classes inherit from
I have the following code and I wanted to create a class that encapsulates
Some background info; LanguageResource is the base class LanguageTranslatorResource and LanguageEditorResource inherit from LanguageResource
I have following class in android, where I am defining some functions to calculate
I want to define inline function within alert class currently i have following implementation.
If I have the following class defined, class Category { /** * * @var
I have defined the following class using COM to use the IGroupPolicyObject using C#.NET:

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.