Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OvertButton(float x, float y, float width, float height, int pressedId, int unPressedId, Resources res, boolean visible) {
- \these are null if xml bitmap is passed
- pressed = BitmapFactory.decodeResource(res, pressedId);
- unPressed = BitmapFactory.decodeResource(res, unPressedId);
- this.visible = visible;
- relocate(x, y);
- resize(width, height); //throws NPE when I createScaledBitmap()
- ClickableManager.registerClickable(this);
- }
- <bitmap xmlns:android="http://schemas.android.com/apk/res/android"
- android:src="@drawable/play_button_pressed"
- android:filter="false"
- android:antialias="false"
- android:dither="false"/>
- @Override
- public void resize(float width, float height) {
- box.set(box.left, box.top, box.left + width, box.top + height);
- Log.d("resize",String.valueOf(height));
- pressed = Bitmap.createScaledBitmap(pressed, (int)width, (int)height, true);
- unPressed = Bitmap.createScaledBitmap(unPressed, (int)width, (int)height, true);
- }
- 04-16 09:45:06.341 11824-11824/com.handmade.eed D/dalvikvm﹕ Late-enabling CheckJNI
- 04-16 09:45:06.450 11824-11824/com.handmade.eed D/MenuActivity﹕ 2130837594$$$2130837596
- 04-16 09:45:06.451 11824-11824/com.handmade.eed D/skia﹕ --- SkImageDecoder::Factory returned null
- 04-16 09:45:06.451 11824-11824/com.handmade.eed D/OvertButton﹕ true2130837591
- 04-16 09:45:06.457 11824-11824/com.handmade.eed D/OvertButton﹕ false2130837595
- 04-16 09:45:06.457 11824-11824/com.handmade.eed D/resize﹕ 252.0
- 04-16 09:45:06.458 11824-11824/com.handmade.eed D/AndroidRuntime﹕ Shutting down VM
- 04-16 09:45:06.459 11824-11824/com.handmade.eed W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x41610d40)
- 04-16 09:45:06.461 11824-11824/com.handmade.eed E/AndroidRuntime﹕ FATAL EXCEPTION: main
- Process: com.handmade.eed, PID: 11824
- java.lang.RuntimeException: Unable to start activity ComponentInfo{com.handmade.eed/com.handmade.eed.MenuActivity}: java.lang.NullPointerException
- at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2209)
- at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2269)
- at android.app.ActivityThread.access$800(ActivityThread.java:139)
- at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1210)
- at android.os.Handler.dispatchMessage(Handler.java:102)
- at android.os.Looper.loop(Looper.java:136)
- at android.app.ActivityThread.main(ActivityThread.java:5102)
- at java.lang.reflect.Method.invokeNative(Native Method)
- at java.lang.reflect.Method.invoke(Method.java:515)
- at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
- at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
- at dalvik.system.NativeStart.main(Native Method)
- Caused by: java.lang.NullPointerException
- at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:615)
- at com.handmade.overt.visible.OvertButton.resize(OvertButton.java:61)
- at com.handmade.overt.visible.OvertButton.<init>(OvertButton.java:29)
- at com.handmade.overt.visible.OvertButton.<init>(OvertButton.java:34)
- at com.handmade.eed.MenuActivity.onCreate(MenuActivity.java:72)
- at android.app.Activity.performCreate(Activity.java:5248)
- at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1110)
- at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2173)
- at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2269)
- at android.app.ActivityThread.access$800(ActivityThread.java:139)
- at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1210)
- at android.os.Handler.dispatchMessage(Handler.java:102)
- at android.os.Looper.loop(Looper.java:136)
- at android.app.ActivityThread.main(ActivityThread.java:5102)
- at java.lang.reflect.Method.invokeNative(Native Method)
- at java.lang.reflect.Method.invoke(Method.java:515)
- at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
- at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
- at dalvik.system.NativeStart.main(Native Method)
- 04-16 09:45:09.872 11824-11824/com.handmade.eed I/Process﹕ Sending signal. PID: 11824 SIG: 9
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement