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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:53:16+00:00 2026-06-16T05:53:16+00:00

List<ActivityManager.RunningTaskInfo > taskInfo = am.getRunningTasks(1); ComponentName componentInfo = taskInfo.get(0).topActivity; componentInfo.getPackageName(); activity = taskInfo.get(0).topActivity.getClassName(); packagename

  • 0
List<ActivityManager.RunningTaskInfo > taskInfo = am.getRunningTasks(1);
                ComponentName componentInfo = taskInfo.get(0).topActivity;
                componentInfo.getPackageName();

                activity = taskInfo.get(0).topActivity.getClassName();
                packagename = componentInfo.getPackageName();

I have this code to get the running activity and package names. My question is:
This package contains another class (Name.java), which is not an activity and returns a String Value that I also need to get.
Is this possible with the ActivityManager?

To be more clear:
the home activity is a screen with a list of items. by sliding to the right or to the left, the screen changes and displays, for example, favorite items, rated items etc. each of those screens/views have a name (Name.java handles it). What I want to do is, to get the name of the current view also, not just the name of the Activity.

  • 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-16T05:53:17+00:00Added an answer on June 16, 2026 at 5:53 am

    No, you can’t get this information using the ActivityManager. The ActivityManager will only give you information about Android components (Activity, Service, BroadcastReceiver, ContentProvider) and their configuration. You can’t access random Java classes within other packages.

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

Sidebar

Related Questions

I'm executing the following piece of code: ActivityManager actvityManager = (ActivityManager) this.getSystemService(ACTIVITY_SERVICE); List<RunningTaskInfo> procInfos
I save all the tasks in the activity manager by using this code List<ActivityManager.RunningAppProcessInfo>
I have :- Class Abc extends Activity(){ private ActivityManager am; private List<RunningAppProcessInfo> rList; @Override
activityManager.getRunningServices(Integer.MAX_VALUE); This method returns a list which includes service which is stopped manually. Settings
PackageManager pm = this.getPackageManager(); ActivityManager am = (ActivityManager) this.getSystemService(Context.ACTIVITY_SERVICE); List<RunningAppProcessInfo> runningAppProcesses = am.getRunningAppProcesses(); for(RunningAppProcessInfo
Hi i have a tab activity which show a list of items (ListView) .
I have code to Post data in server , this is my code List<NameValuePair>
List<int> megalist; int boxId; boxId = ListofUniqueIDSpecificToDate.IndexOf(lstbox.SelectedIndex);<< this is wrong I'm trying to display
List<MyClass> myclassList = (List<MyClass>) rs.get(); TreeSet<MyClass> myclassSet = new TreeSet<MyClass>(myclassList); I don't understand why
i have created a single page application of showing phonebook data in a list.

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.