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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:30:40+00:00 2026-05-26T13:30:40+00:00

I am trying to organize my application into packages because it will have several

  • 0

I am trying to organize my application into packages because it will have several comprehensive list menus. The way I am trying to populate the menus is by finding the activities in each package.

The problem may be with the manifest:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="machinists.toolkit"
android:versionCode="1"
android:versionName="1.0" android:installLocation="auto">

<uses-sdk android:minSdkVersion="8" />

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" android:debuggable="true">
    <activity
        android:label="@string/app_name" 
        android:name=".MTEActivity" 
        android:theme="@android:style/Theme.NoTitleBar">
        <intent-filter >
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name=".ExceptionActivity"></activity>
    <activity android:name=".activities.ReferenceActivity"></activity>
    <activity android:name=".activities.CalculatorActivity"></activity>
    <activity android:name=".activities.reference.FormulasActivity"></activity>
    <activity android:name=".activities.reference.MaterialsActivity"></activity>
</application>

and the snippet in question is:

try {
        this.activities = this.packageManager.getPackageInfo(this.packageName, PackageManager.GET_ACTIVITIES).activities;
    } catch (NameNotFoundException e) {...

In this instance this.packageName solves to machinist.toolkit.activities.reference

The getPackageInfo method calls for the full name of the package and that should be correct if I am understanding.

Any idea what is wrong?

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-05-26T13:30:41+00:00Added an answer on May 26, 2026 at 1:30 pm

    The getPackageInfo method calls for the full name of the package and that should be correct if I am understanding.

    No. You are confusing the package of a class and the package of the application. The value supplied to getPackageInfo() is the package of the application (i.e., the value of your package attribute in the <manifest> element).

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

Sidebar

Related Questions

I'm trying to work out how to organize an android application that will have
I am trying to organize my program into functions and have ran into this,
I am trying to organize a Zip Archive into an array so that I
I'm trying to jump through some hoops to organize data in a special way.
Trying to make a MySQL-based application support MS SQL, I ran into the following
I have developed a blog application of sorts that I am trying to allow
I am trying my first flex application. And have a problems adding data from
I am trying to create a small server type application and have a question
I am trying to organize my code using the revealing module pattern. I have
I'm trying to determine the best way to organize our Maven / Spring web

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.