12-12 02:51:14.438: E/AndroidRuntime(2105): FATAL EXCEPTION: main
12-12 02:51:14.438: E/AndroidRuntime(2105): Process: com.rtminds.patientinformationsystem, PID: 2105 12-12 02:51:14.438: E/AndroidRuntime(2105): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.rtminds.patientinformationsystem/com.rtminds.patientinformationsystem.AddDoctor}: java.lang.NullPointerException 12-12 02:51:14.438: E/AndroidRuntime(2105): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184) 12-12 02:51:14.438: E/AndroidRuntime(2105): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233) 12-12 02:51:14.438: E/AndroidRuntime(2105): at android.app.ActivityThread.access$800(ActivityThread.java:135) 12-12 02:51:14.438: E/AndroidRuntime(2105): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 12-12 02:51:14.438: E/AndroidRuntime(2105): at android.os.Handler.dispatchMessage(Handler.java:102) 12-12 02:51:14.438: E/AndroidRuntime(2105): at android.os.Looper.loop(Looper.java:136) 12-12 02:51:14.438: E/AndroidRuntime(2105): at android.app.ActivityThread.main(ActivityThread.java:5001) 12-12 02:51:14.438: E/AndroidRuntime(2105): at java.lang.reflect.Method.invokeNative(Native Method) 12-12 02:51:14.438: E/AndroidRuntime(2105): at java.lang.reflect.Method.invoke(Method.java:515) 12-12 02:51:14.438: E/AndroidRuntime(2105): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785) 12-12 02:51:14.438: E/AndroidRuntime(2105): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) 12-12 02:51:14.438: E/AndroidRuntime(2105): at dalvik.system.NativeStart.main(Native Method) 12-12 02:51:14.438: E/AndroidRuntime(2105): Caused by: java.lang.NullPointerException 12-12 02:51:14.438: E/AndroidRuntime(2105): at com.rtminds.patientinformationsystem.AddDoctor.onCreate(AddDoctor.java:76) 12-12 02:51:14.438: E/AndroidRuntime(2105): at android.app.Activity.performCreate(Activity.java:5231) 12-12 02:51:14.438: E/AndroidRuntime(2105): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 12-12 02:51:14.438: E/AndroidRuntime(2105): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148) 12-12 02:51:14.438: E/AndroidRuntime(2105): ... 11 more
public class Add_Details extends Activity {
ImageButton addDoctor_img, addPatient_img, viewPatient_img;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add__details);
addDoctor_img = (ImageButton) findViewById(R.id.addDoctor_detils);
addPatient_img = (ImageButton) findViewById(R.id.addPatient_detils);
viewPatient_img = (ImageButton) findViewById(R.id.viewPatient_detils);
configureImageButton();
}
public void configureImageButton() {
// TODO Auto-generated method stub
try {
// add doctor details...
addDoctor_img.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent add_doc = new Intent(getApplicationContext(),
AddDoctor.class);
startActivity(add_doc);
finish();
}
});
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
}
public class AddDoctor extends Activity implements OnClickListener {
EditText f_name_doc, l_name_doc, suffix_doc, email_doc, password_doc,
confirm_doc, mob_doc, dob_doc, age_doc, specility_doc, city_doc;
RadioGroup gender;
RadioButton male_doc, female_doc;
Button add_doc;
ImageButton cal_dob;
private Calendar cal;
private int day;
private int month;
private int year;
static String URL = OpdLogin.URL;
public static final String url_adddoc = URL + "doctorregistration";
HttpClient client;
String text;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_doctor);
f_name_doc = (EditText) findViewById(R.id.f_name_doc);
l_name_doc = (EditText) findViewById(R.id.l_name_doc);
suffix_doc = (EditText) findViewById(R.id.suffix_doc);
email_doc = (EditText) findViewById(R.id.email_doc);
password_doc = (EditText) findViewById(R.id.password_doc);
confirm_doc = (EditText) findViewById(R.id.confirm_doc);
mob_doc = (EditText) findViewById(R.id.mob_doc);
dob_doc = (EditText) findViewById(R.id.dob_doc);
age_doc = (EditText) findViewById(R.id.age_doc);
specility_doc = (EditText) findViewById(R.id.specility_doc);
city_doc = (EditText) findViewById(R.id.city_doc);
<ImageButton
android:id="@+id/addDoctor_detils"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_marginBottom="0dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="20dp"
android:layout_marginTop="30dp"
android:contentDescription="@string/AddDoctor"
android:onClick="configureImageButton"
android:padding="50dp"
android:src="@drawable/doctor_add" />
<activity
android:name=".AddDoctor"
android:label="@string/title_activity_add_doctor" >
<intent-filter>
<action android:name="com.rtminds.patientinformationsystem.AddDoctor" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>