I have to suggest that line 23 as you indicate is incorrect; there's no
executable code there, not even if we assume it refers to the onCreate()
definition.
In the sample you gave us, possibilities for the problem reference include
R, R.layout, 'enter', 'moe' and the result of new Intent(moe). I seriously
doubt that 'this' can be null (which would cause failure at
setContentView(), findViewById() and possibly super.onCreate() and
getApplicationContext() ), since this is being called from an object just
constructed by the system, and I find it hard to believe 'R' or its layout
is null... but you never know.
Although you are using the camera, it certainly doesn't have any related
code in this file (at least, not where you show us the sample), so I will
assume it is not the problem; however, I did forget to suggest rebooting
your phone, in case it is out of memory for some reason. Not sure if you
already did that.
If it is still a problem then, I would start trying to examine the value of
some references during that little piece of code you showed us to find the
actual culprit. Maybe then we can figure out from where and for why. If
you're desperate, try using
Toast.makeText(this, ..., Toast.LENGTH_SHORT).show();
before and after each line to figure out how far it gets before it fails.
(BTW, the 'Button enter' you declared at class scope is being hidden by the
'Button enter' you declare temporarily later, to which you assign the result
of findViewById(). If you subsequently try to refer to 'enter' in other
methods of that class, *that* will *definitely* cause a problem, probably a
NullPointerException. Do *not* try and set the class version of 'enter' to
the result of findViewById() - I believe it is a bad idea to try and keep
such references to controls across method calls.)
--
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