开发者

How to investigate android market application error report

I have a simple android app on the market. I have noticed some error reports and I want to fix the errors however, I cannot reproduce these errors. So I have a few questions

  1. Is it possible to know or guess if these errors are hardware specific?
  2. If errors are device specific, how can I attempt to fix the problem without knowing what device was used and without owning that particular device
  3. If anyone could point me in the right direction with this specific error, that would be much appreciated

Here's the error report

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.slamdunksoftware.techitotpets/com.slamdunksoftware.techitotpets.Main}: java.lang.NullPointerException at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2753) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2769) at and开发者_开发知识库roid.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3905) at android.app.ActivityThread.access$2600(ActivityThread.java:129) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2121) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:143) at android.app.ActivityThread.main(ActivityThread.java:4717) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:521) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.NullPointerException at com.slamdunksoftware.techitotpets.Main.onCreate(Main.java:81) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2717)

And here's the class (Line 81 is music.setLooping(false) near the bottom)

public class Main extends Activity {

 MediaPlayer music;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);       

        // Hide the Title Bar
     requestWindowFeature(Window.FEATURE_NO_TITLE); 
     setContentView(R.layout.main);

     // Hide the Status Bar
     getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
        WindowManager.LayoutParams.FLAG_FULLSCREEN);

     // Set to landscape
     setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);


     ImageButton btnMemory = (ImageButton) findViewById(R.id.btnMemory);
     ImageButton btnStickers = (ImageButton) findViewById(R.id.btnStickers);
     ImageButton btnDot2Dot = (ImageButton) findViewById(R.id.btnDot2Dot);
     ImageButton btnWindow = (ImageButton) findViewById(R.id.btnWindow);

        btnMemory.setOnClickListener(new View.OnClickListener() {           

         public void onClick(View view) {
          Intent intent = new Intent(Main.this, Memory.class);
          startActivity(intent);
             setResult(RESULT_OK, intent);
             finish();                      
         }
        }); 

        btnStickers.setOnClickListener(new View.OnClickListener() {           

         public void onClick(View view) {
          Intent intent = new Intent(Main.this, Stickers.class);
          startActivity(intent);
             setResult(RESULT_OK, intent);
             finish();                      
         }
        }); 

        btnDot2Dot.setOnClickListener(new View.OnClickListener() {           

    public void onClick(View view) {
        Intent intent = new Intent(Main.this, Dot2Dot.class);
        startActivity(intent);
           setResult(RESULT_OK, intent);
           finish();                      
       }
   });

        btnWindow.setOnClickListener(new View.OnClickListener() {           

    public void onClick(View view) {
        Intent intent = new Intent(Main.this, WindowWasher.class);
        startActivity(intent);
           setResult(RESULT_OK, intent);
           finish();                      
       }
   });

        // Music
        music = MediaPlayer.create(this, R.raw.techitot);
  music.setLooping(false);
  music.start();

    }

    @Override
    public void onDestroy()
    {
     music.stop();
     super.onDestroy();
    }
    @Override
    public void onPause()
    {
     super.onPause();
     music.stop();     
    }
}


The error is at line 81 in your source code for com.slamdunksoftware.techitotpets.Main for the version you deployed to the market.

Caused by: java.lang.NullPointerException at        com.slamdunksoftware.techitotpets.Main.onCreate(Main.java:81)

You will need to see what you are doing on this line in your code. If it is in the area where you are initializing you music player then you may have device specific issues. I know I have had issues with the sound api's in Android across devices.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜