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

  • Home
  • SEARCH
  • 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 4073004
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T16:57:27+00:00 2026-05-20T16:57:27+00:00

I have an instance of an Activity in a helper class and I’m trying

  • 0

I have an instance of an Activity in a helper class and I’m trying to obtain attributes from its entry in the AndroidManifest.xml file.

I can get a list of all of the ActivityInfo instances but how do I to target the specific one for my application?

The activity instance is not in the same package as the helper class and not defined in the same manifest (helper class is a library included in the activity’s application project).

What I have so far:

Activity activity = //the instance
String applicationPackage = activity.getApplicationInfo().packageName;
PackageInfo info = activity.getPackageManager().getPackageInfo(packageName, PackageManager.GET_ACTIVITIES);
for (ActivityInfo activityInfo : info.activities) {
    if (/* activityInfo applies to our activity instance */) {
        return activityInfo.someProperty;
    }
}
  • 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-20T16:57:29+00:00Added an answer on May 20, 2026 at 4:57 pm

    My understanding of your question: You need to get the information about a particular Activity within your Application.

    Currently you are using getPackageInfo to obtain your package information from the package manager, but you don’t need to do this if you only care about one Activity within the Application. You can use getActivityInfo instead, so long as you know the fully qualified name of the Activity and use a ComponentName, ex: com.example.myapp/com.example.myapp.myactivity

    PackageManager Docs

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

Sidebar

Related Questions

I have an Activity class which has an attribute that references an AsyncTask instance
I am trying to call an Activity from another instance of the activity. The
I have an instance of the Popen class created through subprocess.Popen. I would like
I have an instance of Class A that I want to refer to in
I have an app that has a list as its main activity and then
I've my main custom listactivity class that have a instance object of my custom
I have class that extends 'IntentService' - this class occasionally receives data from a
I have a view subclass that starts from activity subclass like that: this.setContentView(instanceOfMyView); In
I have 2 activities A and B. I call activity B from activity A
I am confused between NSString and NSMutable string usage. Suppose I have instance variables

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.