What is this error, my project suddenly doesn't want to execute,
j"ava.lang.RuntimeException: Unable to start activity
ComponentInfo{project.moe/project.moe.ProjectActivity}:
java.lang.NullPointerException".. I didn't change anythingOn Sun, May 6, 2012 at 4:26 PM, Jason Teagle <[email protected]> wrote: > For testing purposes, I would suggest you temporarily put the camera code > aside, and do some testing on a simply image loaded from resources. My > reason for saying this is to remove any possible outside issues, and just > concentrate on the scaling of an image. I see your code, which seems like > it *should* work, although we can't see how you form the 'matrix' variable, > which may be the problem. > > This code, for example, worked fine for me (logo is 141 x 36, a JPG): > > --- > // Scale twice as high: > Bitmap logo = BitmapFactory.decodeResource(**getResources(), > R.drawable.logo); > Matrix m = new Matrix(); > m.postScale(1.0f, 2.0f, logo.getWidth() * 0.5f, logo.getHeight() * 0.5f); > logo = Bitmap.createBitmap(logo, 0, 0, logo.getWidth(), logo.getHeight(), > m, true); > --- > > Once you can satisfy yourself that the actual scaling is working as > expected, then you can start looking for outside problems - such as how you > generate 'matrix', for example. It would also be worth drawing the picture > you get from your camera as-is, alongside the result of your attempts to > 'correct' it, to make sure your source picture is actually coming through > the way you think it is. You'll kick yourself if you find it's already > coming through rotated or something! > > > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to > android-developers@**googlegroups.com<[email protected]> > To unsubscribe from this group, send email to > android-developers+**[email protected]<android-developers%[email protected]> > For more options, visit this group at > http://groups.google.com/**group/android-developers?hl=en<http://groups.google.com/group/android-developers?hl=en> > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

