In my code I am getting this error. I pasted full log cat
java.lang.RuntimeException: Unable to start activity
java.lang.RuntimeException: Unable to start activity ComponentInfo{
sa.app.activity.EmailRegistartion<http://sa.appoptix.com/sa.appoptix.com.activity.EmailRegistartion>}:
java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(
ActivityThread.java:1970)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1995)
at android.app.ActivityThread.access$600(ActivityThread.java:128)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1161)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4514)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(
ZygoteInit.java:790)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at sa.appoptix.com.activity.EmailRegistartion.onCreate(Unknown Source)
at android.app.Activity.performCreate(Activity.java:4465)
at android.app.Instrumentation.callActivityOnCreate(
Instrumentation.java:1053)
at android.app.ActivityThread.performLaunchActivity(
ActivityThread.java:1934)
... 11 more
My oncreate metode contains following code
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.registration);
/* To calculate uId in email sending path */
TelephonyManager teleman = (TelephonyManager) getBaseContext()
.getSystemService(Context.TELEPHONY_SERVICE);
sws = new SaWebService();
deviceId = teleman.getDeviceId();
uId = deviceInfo();
re = RegisteredEmail.getInstance(this);
prefs = getApplicationContext().getSharedPreferences("email_id",
MODE_PRIVATE);
btn = (Button) findViewById(R.id.email_submit);
new_reg = (Button) findViewById(R.id.newuser_signup);
new_reg.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Intent viewIntent = new Intent(
"android.intent.action.VIEW",
Uri.parse("http://panel.strategyanalytics.com/default.aspx?mod=registrationfull"));
startActivity(viewIntent);
}
});
email = (EditText) findViewById(R.id.email);
email.setOnFocusChangeListener(new OnFocusChangeListener() {
public void onFocusChange(View v, boolean hasFocus) {
email.setHint("");
}
});
btn.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
email = (EditText) findViewById(R.id.email);
emailStr = email.getText().toString();
new AddTask().execute();
setContentView(R.layout.main);
email.setText("");
}
});
}
Help me out where I am going wrong. Thanks for help in advance.
Thanks,
Thejaswi
--
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