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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:21:54+00:00 2026-06-04T03:21:54+00:00

I have Activity A, Activity B, and a static class in the same application.

  • 0

I have Activity A, Activity B, and a static class in the same
application. The scenario is as follows (it’s simplified here; it
makes more sense in my software):

  1. (in Activity A) mAppctx = this.getApplicationContext();
  2. (in Activity A) StaticClass.appctx = mAppctx;
  3. Activity B is spawned
  4. Assume that Activity A is destroyed by the system while Activity B
    is running
  5. Activity B does the following (pseudo-code):
    ….. = StaticClass.appctx.getResources().openRawResource(…);

Is this correct?

Since an application Context belongs to the Application (i.e. to the
process), and not to the Activity, I suppose it’s correct, and APK
resources can be accessed in this way from the static class without
any problem. (I know that Activity B could actually ask getApplicationContext() on his own, but the above question is intentionally different.)

  • 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-04T03:21:56+00:00Added an answer on June 4, 2026 at 3:21 am

    Yes, it is correct as both activity and aplication context access same resources.

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

Sidebar

Related Questions

I have an Android application with a main activity that is the tabhost. I'm
In my Android application i have a tracker activity in which i retrieve the
In my activity, I have a inner class called A extends AsyncTask . I
I have a class that extends Activity and within it got a private class
I'm writing a plugin-enabled android application here. I have 2 applications(2 apk), one is
This is making me a bit crazy. I have the following Application: Activity A
I have Activity A with android:launchMode=singleTop in the manifest. If I go to Activity
I have Activity with ListView inside it and in the onCreate method of the
in my app i have activity with XML layout, i want to build an
I am having trouble with my activity management. So I have activity A which

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.