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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:51:28+00:00 2026-06-07T04:51:28+00:00

07-08 17:04:34.978: E/AndroidRuntime(322): FATAL EXCEPTION: main 07-08 17:04:34.978: E/AndroidRuntime(322): java.lang.RuntimeException: Unable to start activity

  • 0
07-08 17:04:34.978: E/AndroidRuntime(322): FATAL EXCEPTION: main
07-08 17:04:34.978: E/AndroidRuntime(322): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.gurpswu.gurps/com.gurpswu.gurps.Home}: java.lang.NullPointerException
07-08 17:04:34.978: E/AndroidRuntime(322):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
07-08 17:04:34.978: E/AndroidRuntime(322):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
07-08 17:04:34.978: E/AndroidRuntime(322):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
07-08 17:04:34.978: E/AndroidRuntime(322):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
07-08 17:04:34.978: E/AndroidRuntime(322):  at android.os.Handler.dispatchMessage(Handler.java:99)
07-08 17:04:34.978: E/AndroidRuntime(322):  at android.os.Looper.loop(Looper.java:123)
07-08 17:04:34.978: E/AndroidRuntime(322):  at android.app.ActivityThread.main(ActivityThread.java:3683)
07-08 17:04:34.978: E/AndroidRuntime(322):  at java.lang.reflect.Method.invokeNative(Native Method)
07-08 17:04:34.978: E/AndroidRuntime(322):  at java.lang.reflect.Method.invoke(Method.java:507)
07-08 17:04:34.978: E/AndroidRuntime(322):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
07-08 17:04:34.978: E/AndroidRuntime(322):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
07-08 17:04:34.978: E/AndroidRuntime(322):  at dalvik.system.NativeStart.main(Native Method)
07-08 17:04:34.978: E/AndroidRuntime(322): Caused by: java.lang.NullPointerException
07-08 17:04:34.978: E/AndroidRuntime(322):  at com.gurpswu.gurps.Player.getIntField(Player.java:153)
07-08 17:04:34.978: E/AndroidRuntime(322):  at com.gurpswu.gurps.Home.hudSetup(Home.java:102)
07-08 17:04:34.978: E/AndroidRuntime(322):  at com.gurpswu.gurps.Home.onCreate(Home.java:25)
07-08 17:04:34.978: E/AndroidRuntime(322):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-08 17:04:34.978: E/AndroidRuntime(322):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
07-08 17:04:34.978: E/AndroidRuntime(322):  ... 11 more

I have a game. When the user opens the app for the first time and presses the continue game button..the game will attempt to retrieve values from the database using the code below.

            stats.open();
    playerId = stats.getIntField(stats.KEY_ROWID);
    String playerName = stats.getStringField(stats.KEY_NAME);
    String playerCity = stats.getStringField(stats.KEY_CITY);
    playerHealth = stats.getIntField(stats.KEY_HEALTH);
    playerEnergy = stats.getIntField(stats.KEY_ENERGY);
    playerRank = stats.getIntField(stats.KEY_RANK);
    playerCash = stats.getIntField(stats.KEY_CASH);
    stats.close();

However, none of these database fields are populated…how do install a check..so that this code is only run if a database exists. If it does not exist then it will ask the player to start a new game.

  • 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-07T04:51:30+00:00Added an answer on June 7, 2026 at 4:51 am

    there must be a check on stats after you do stats.open(), you should call something which returns number of rows. you can put a condition if rows are 0.

    or you can have try catch with NullPExe

    try{
        stats.open();
        playerId = stats.getIntField(stats.KEY_ROWID);
        String playerName = stats.getStringField(stats.KEY_NAME);
        String playerCity = stats.getStringField(stats.KEY_CITY);
        playerHealth = stats.getIntField(stats.KEY_HEALTH);
        playerEnergy = stats.getIntField(stats.KEY_ENERGY);
        playerRank = stats.getIntField(stats.KEY_RANK);
        playerCash = stats.getIntField(stats.KEY_CASH);
        stats.close();
    } catch(NullPointerException e) { .. do needful or return null }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In the classic RESTful Web Services book (O'Reilly, ISBN 978-0-596-52926-0) it says on page
In the second edition of Effective C# (ISBN-13: 978-0321658708) on page 37, the book
I've attempted with both 978.gs and Blueprint to create the following layout: I know
I tried using Kohana/ORM on my localhost xampp and i get the following error
I have a txt plain file that has a list of numbers. One number
I am looking for a SQL Server function that I can supply 3 primary
I'd like to make an application that removes duplicates from my wpl (Windows PlayList)
What would be the first thing that someone would check to resolve the UnsupportedOperationException
I keep getting this error: MySQL said: #1064 - You have an error in
How build ASP.NET MVC View page from XML file? <?xml version=1.0 encoding=utf-8 ?> -

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.