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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:43:28+00:00 2026-05-30T11:43:28+00:00

I am learning extensively about getters and setters but I seem not to be

  • 0

I am learning extensively about getters and setters but I seem not to be having my way.
I have a class called Apps_Info which contains my setters and getters and I have my main activity FavouriteApps that has a list which uses the class Apps_Info.
I am trying to get the name of the package from the List in FavouriteApps but I am still getting null.
Please can someone tell what to do? Below is the code in this order: class Apps_Info and FavouriteApps activity

public class Apps_Info {
    private Bitmap bIcon;
    private String sName;
    private String sPacks_Name;

    public Apps_Info(Bitmap icon, String name, String Packs_Name) {
        bIcon = icon;
        sName = name;
        sPacks_Name = Packs_Name;
    }

    public void setIcon(Bitmap icon) {
        bIcon=icon;
    }

    public Bitmap getIcon() {
        return bIcon;
    }

    public void setName(String name) {
        sName=name;
    }

    public String getName() {
        return sName;
    }

    public void setPacks_Name(String Packs_Name) {
        this.sPacks_Name=Packs_Name;
    }

    public String getPacks_Name() {
        return sPacks_Name;
    }
}

FavouriteApps Activity code (part)

String packname, packsname, apps_names;
Bitmap app_icon; 
Resources res = getResources();
List<Apps_Info> ListApps_Info = new ArrayList<Apps_Info>();
ListApps_Info.add(new Apps_Info(BitmapFactory.decodeResource(res, R.drawable.browser_app), "Browser", "com.browser"));
ListApps_Info.add(new Apps_Info(BitmapFactory.decodeResource(res, R.drawable.clock_app), "Alarm Clock", "com.alarm.clock"));
ListApps_Info.add(new Apps_Info(BitmapFactory.decodeResource(res, R.drawable.threegplus), "3G Secure Connection", "threeg.secureconnect"));

mGridView.setAdapter(new Apps_Info_Adapter(this, ListApps_Info));
Apps_Info packinfo = new Apps_Info(app_icon, apps_names, packname);
packsname = packinfo.getPacks_Name();
apps_names = packinfo.getName();
Log.i("The Pack_Name is " + packsname, "Pack Name");
  • 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-30T11:43:30+00:00Added an answer on May 30, 2026 at 11:43 am

    You should do like this.

    for (int i = 0; i < ListApps_Info.size(); i++) {
        Apps_Info packinfo = ListApps_Info.item(i);
        packsname = packinfo.getPacks_Name();
        apps_names = packinfo.getName();
        Log.i("The Pack_Name is " + packsname, "Pack Name");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I learning LINQ, and i want to use pending request, but i have this
I am working on a personal project as a way of learning more about
I'm learning mysql and have been trying to get this working, but an error
learning Jquery and integrating with PHP - getting there, but have one last challenge
I'm currently learning Magento and seem to have come across a problem that is
Learning Javascript and have a question about global variables. From my reading, most recommend
Learning C at University. This is not a homework, but I was trying to
Learning a little about T-SQL, and thought an interesting exercise would be to generate
Learning from my last question , most member names seem to get included in
Learning xml, Can anyone help me? I have following XML code: **<book lang=en>name of

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.