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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:48:00+00:00 2026-06-10T03:48:00+00:00

I read this tutorial and using code from it to implement ScoreLoop service in

  • 0

I read this tutorial and using code from it to implement ScoreLoop service in my Game. And submiting score working fine, but show other android activity or simple Toast message are crashes with NullPointer error.

Crashes in line:

Intent intent = new Intent(mContext, EntryScreenActivity.class);

and in:

Toast.makeText(mContext, "Refreshing scores", Toast.LENGTH_SHORT).show(); 

In debug mode i saw that mContext is not null

Where is error and how fix it?

LogCat:

08-22 17:54:27.329: E/AndroidRuntime(15468): java.lang.NullPointerException 08-22 17:54:27.329: E/AndroidRuntime(15468): at android.content.ContextWrapper.getResources(ContextWrapper.java:81) 08-22 17:54:27.329: E/AndroidRuntime(15468): at android.widget.Toast.<init>(Toast.java:92) 08-22 17:54:27.329: E/AndroidRuntime(15468): at android.widget.Toast.makeText(Toast.java:233) 08-22 17:54:27.329: E/AndroidRuntime(15468): at com.masterofcode.android.slingshot.ActionResolverAndroid$3.run(ActionResolverAndroid.java:46) 08-22 17:54:27.329: E/AndroidRuntime(15468): at android.os.Handler.handleCallback(Handler.java:605) 08-22 17:54:27.329: E/AndroidRuntime(15468): at android.os.Handler.dispatchMessage(Handler.java:92) 08-22 17:54:27.329: E/AndroidRuntime(15468): at android.os.Looper.loop(Looper.java:137) 08-22 17:54:27.329: E/AndroidRuntime(15468): at android.app.ActivityThread.main(ActivityThread.java:4424) 08-22 17:54:27.329: E/AndroidRuntime(15468): at java.lang.reflect.Method.invokeNative(Native Method) 08-22 17:54:27.329: E/AndroidRuntime(15468): at java.lang.reflect.Method.invoke(Method.java:511) 08-22 17:54:27.329: E/AndroidRuntime(15468): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 08-22 17:54:27.329: E/AndroidRuntime(15468): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 08-22 17:54:27.329: E/AndroidRuntime(15468): at dalvik.system.NativeStart.main(Native Method)

========================================================================

public class ActionResolverAndroid implements ActionResolver {
  Handler uiThread;
  BumbleAndroid mContext; //Your class here which extends AndroidApplication
  ScoreloopHandler handler;

  public ActionResolverAndroid(BumbleAndroid mContext) {
      uiThread = new Handler(); //This binds the handler to the "main" thread, see documentation of handler
      this.mContext = mContext;
      handler = new ScoreloopHandler(mContext);
  }
}

In this way I getting mContext

  • 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-10T03:48:01+00:00Added an answer on June 10, 2026 at 3:48 am

    The problem was in wrong mContext.

    correct code is:

    public class MyGameAndroidActivity extends AndroidApplication implements
            ActionResolver {
    public void showScoreloop() {
            Intent intent = new Intent(this, EntryScreenActivity.class);
            this.startActivity(intent);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I read the tutorial from some web, and they did something like this.
I have to read data from mdb-files using c++ but I'm having trouble getting
I just found out this code from a tutorial for matrix addition in c++
To review regular expresions I read this tutorial . Anyways that tutorial mentions that
I am new to WP7. I followed this tutorial to read and write a
I read this code in a library which is used to display a bitmap
I'm using the JDBC template and want to read from a database using prepared
I'm aggregating RSS feeds using FeedTools. I followed this tutorial: http://simonwoodside.com/weblog/2008/12/7/ruby_on_rails_feedrss_aggregator/ and everything functioned
reading this https://developers.google.com/in-app-payments/docs/tutorial Quoted from the above page: Because you sign the JWT using
I've been following the tutorial at http://iphonebyradix.blogspot.com/2011/03/read-and-write-data-from-plist-file.html showing how to extract data from a

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.