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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:32:14+00:00 2026-05-26T17:32:14+00:00

Here are the values I want to get in another class. @Override protected void

  • 0

Here are the values I want to get in another class.

@Override
protected void onCreate(Bundle savedInstanceState) {
    setContentView(new RealPlayView(this));
    super.onCreate(savedInstanceState);
    DisplayMetrics dm = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(dm);
    int width = dm.widthPixels;
    int height = dm.heightPixels;
}

In my class I want to get the width and height but so far I haven’t been able to.

Any tips?

I’ve tried putting the DisplayMetrics into difference methods and then trying to call those methods in my other class but its giving me errors.

Is there any way I can get these values into my class?

  • 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-26T17:32:15+00:00Added an answer on May 26, 2026 at 5:32 pm

    You can use your data from one activity in some other activity in many ways:

    If you want to use data from one activity immediately in some other activity then you can use Intents for that.Here is an example for it How to pass an object from one activity to another on Android and for more information you can refer to http://developer.android.com/guide/topics/intents/intents-filters.html

    You can also store data from one activity in some files and then read from them in other activity. Here is all you need to know about Data Storage http://developer.android.com/guide/topics/data/data-storage.html

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

Sidebar

Related Questions

If you want to associate some constant value with a class, here are two
I have an issue going on here. I am using PHP to get values
I have a class that I want to use to store properties for another
I cannot bubble the event because I want to send to another class that
Here is what I have- How I can include multiple keys and their values
Here is my SQLCommand object: oCommand.CommandText = INSERT INTO hits (id,client_id,client_ip,page,vars) VALUES _ (@@IDENTITY,@client_id,@ip,@page,@vars)
According to here , the C compiler will pad out values when writing a
I need to add values received from MySQL into an array (PHP). Here is
I am trying to convert all DateTime values in a DataTable to strings. Here
I need to change some custom properties values in many files. Here is an

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.