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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:31:10+00:00 2026-06-10T10:31:10+00:00

Java: in android SDK How do I call a method from another class in

  • 0

Java: in android SDK
How do I call a method from another class in an onCreate() method?

LOGCAT:

08-28 22:27:24.152: W/dalvikvm(13642): threadid=1: thread exiting with uncaught exception (group=0x40015578)
08-28 22:27:24.156: E/AndroidRuntime(13642): FATAL EXCEPTION: main
08-28 22:27:24.156: E/AndroidRuntime(13642): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.valgriz.high.low/com.valgriz.high.low.Game}: java.lang.NullPointerException
08-28 22:27:24.156: E/AndroidRuntime(13642):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
08-28 22:27:24.156: E/AndroidRuntime(13642):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
08-28 22:27:24.156: E/AndroidRuntime(13642):    at android.app.ActivityThread.access$1500(ActivityThread.java:117)
08-28 22:27:24.156: E/AndroidRuntime(13642):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
08-28 22:27:24.156: E/AndroidRuntime(13642):    at android.os.Handler.dispatchMessage(Handler.java:99)
08-28 22:27:24.156: E/AndroidRuntime(13642):    at android.os.Looper.loop(Looper.java:130)
08-28 22:27:24.156: E/AndroidRuntime(13642):    at android.app.ActivityThread.main(ActivityThread.java:3687)
08-28 22:27:24.156: E/AndroidRuntime(13642):    at java.lang.reflect.Method.invokeNative(Native Method)
08-28 22:27:24.156: E/AndroidRuntime(13642):    at java.lang.reflect.Method.invoke(Method.java:507)
08-28 22:27:24.156: E/AndroidRuntime(13642):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
08-28 22:27:24.156: E/AndroidRuntime(13642):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
08-28 22:27:24.156: E/AndroidRuntime(13642):    at dalvik.system.NativeStart.main(Native Method)
08-28 22:27:24.156: E/AndroidRuntime(13642): Caused by: java.lang.NullPointerException
08-28 22:27:24.156: E/AndroidRuntime(13642):    at android.app.Activity.findViewById(Activity.java:1647)
08-28 22:27:24.156: E/AndroidRuntime(13642):    at com.valgriz.high.low.Package.runThis(Package.java:16)
08-28 22:27:24.156: E/AndroidRuntime(13642):    at com.valgriz.high.low.Game.onCreate(Game.java:34)
08-28 22:27:24.156: E/AndroidRuntime(13642):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-28 22:27:24.156: E/AndroidRuntime(13642):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
08-28 22:27:24.156: E/AndroidRuntime(13642):    ... 11 more
  • 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-10T10:31:11+00:00Added an answer on June 10, 2026 at 10:31 am

    Something like this:

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main );
    
        MyClass work = new MyClass();
        work.doSomething();
    
    }
    
    public class MyClass{
    
        public void doSomething(){
            Log.d("tag", "yes sir!");
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can i call perspectiveM static method in Matrix class? As said here: http://developer.android.com/reference/android/opengl/Matrix.html
Facebook Android SDK when running example apps gives 11-14 23:17:58.484: ERROR/HttpOperation.run(1139): class java.net.UnknownHostException api.facebook.com
I installed: Android SDK Cygwin Ant Android NDK Java Eclipse and Download Moai SDK
I found this Is Sun Java really necessary for using Android SDK on Ubuntu
Is it possible in Java (Android) to implement a customized version of a Thread
what is annotation class. what is the use of it in java/android. In iphone
I use the Java Android SDK in Eclipse for mobile development, in which I
I am using Eclipse with Java and the Android SDK. I have a while
I'm beginner in Java Android developing. I'm using Eclipse SDK 3.6.1 version. I'm trying
I'm beginner in Java Android developing. I'm using Eclipse SDK 3.6.1 version. I'm trying

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.