java - Getting error in app i am trying to build, new to android development -


i have app purchased learn on , i'm getting weird error in android studio, not sure turn. thought maybe brains here point me in right direction. error getting is:

error:(63, 10) error: cannot find symbol class userdata  error:(72, 15) error: cannot find symbol variable userdata  error:execution failed task ':app:compilereleasejavawithjavac'. 

compilation failed; see compiler error output details.

the driverfragment.java section error pointing too. have attached code here if needed.

 package com.epbit.fragments;  import android.app.activity; import android.app.dialog; import android.content.broadcastreceiver; import android.content.context; import android.content.dialoginterface; import android.content.intent; import android.content.intentfilter; import android.content.sharedpreferences; import android.content.res.resources; import android.net.uri; import android.os.bundle; import android.support.annotation.nullable; import android.support.v7.app.alertdialog; import android.support.v7.app.appcompatactivity; import android.util.log; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.view.window; import android.widget.adapterview; import android.widget.imagebutton; import android.widget.imageview; import android.widget.linearlayout; import android.widget.listview; import android.widget.textview; import android.widget.toast;  import com.epbit.fcm.commonutilities; import com.epbit.alertspinner.iam_customlist; import com.epbit.ccv3.mainactivity; import com.epbit.ccv3.r; import com.epbit.constants.appconstants; import com.epbit.constants.iwebconstant; import com.epbit.latlong.latlongdetails; import com.epbit.login.logindetails; import com.epbit.login.passengerdetails; import com.epbit.model.driverdetails; import com.epbit.services.confirmrejectcabservice; import com.epbit.services.driverstatusupdate; import com.epbit.services.driver_loc_update_task; import com.epbit.services.getdriverstatus; import com.epbit.utils.gpstracker; import com.epbit.utils.wakelocker;  public class driverfragment extends basefragment implements view.onclicklistener {     private context context;     boolean doublebacktoexitpressedonce = false;     private gpstracker gpstracker;     private latlongdetails driver_latlongobj = new latlongdetails();     private linearlayout statuslinearlayout, pass_detail_layout, button_layout,             details_layout, update_profile;     private textview driverstatustextview, linear, pass_name, pass_num, pick_loc,             drop_loc, pick_date, pick_time, pick_time_left, pick_date_left, fare_value;     private imageview driverstatusimageview, imageviewphone;     public dialog dialog;     public listview list;     //driverdetails driver_latlongobj = new driverdetails();     imagebutton confirm_driver, reject_driver;     private boolean first_time_flage;     private string phonenumber, first_time_tag = "first_time_flag";     private userdata userdata;      @nullable     @override     public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) {         view root = inflater.inflate(r.layout.fragment_driver, null);         ((appcompatactivity) getactivity()).getsupportactionbar().settitle(r.string.cabbooking_driver);         try {             context = getactivity();             userdata = userdata.getinstance(context);             driverdetails.setdriverstatus("");             sharedpreferences mypreferences = context.getsharedpreferences("myprefreferences", 0);             statuslinearlayout = (linearlayout) root.findviewbyid(r.id.driverstatusllid);             driverstatusimageview = (imageview) root.findviewbyid(r.id.driverstatusimgid);             pass_detail_layout = (linearlayout) root.findviewbyid(r.id.passenger_layout_id);             button_layout = (linearlayout) root.findviewbyid(r.id.driver_buttons_linear_id);             pass_name = (textview) root.findviewbyid(r.id.cust_name_dri);             pass_num = (textview) root.findviewbyid(r.id.cust_num_dri);             pick_loc = (textview) root.findviewbyid(r.id.pick_loc_dri);             drop_loc = (textview) root.findviewbyid(r.id.drop_loc_dri);             pick_time = (textview) root.findviewbyid(r.id.pick_time_dri);             pick_date = (textview) root.findviewbyid(r.id.pick_date_dri);             fare_value = (textview) root.findviewbyid(r.id.fare_value);             pick_date_left = (textview) root.findviewbyid(r.id.pick_up_date_tex);             pick_time_left = (textview) root.findviewbyid(r.id.pick_up_time_tex);             driverstatustextview = (textview) root.findviewbyid(r.id.driverstatustextid);             imageviewphone = (imageview) root.findviewbyid(r.id.imageviewphone);             confirm_driver = (imagebutton) root.findviewbyid(r.id.confirm_img_dri);             reject_driver = (imagebutton) root.findviewbyid(r.id.reject_img_dri);             details_layout = (linearlayout) root.findviewbyid(r.id.details_layout);             update_profile = (linearlayout) root.findviewbyid(r.id.updateprofile);             imageviewphone.setonclicklistener(this);             setlinearlayoutonclicklistener(context, statuslinearlayout,                     driverstatusimageview, driverstatustextview);             first_time_flage = mypreferences.getboolean(first_time_tag, true);             if (first_time_flage) {                 update_profile.setvisibility(view.visible);                 first_time_flage = false;                 sharedpreferences.editor editor = mypreferences.edit();                 editor.putboolean(first_time_tag, first_time_flage);                 editor.commit();             }             new getdriverstatus(context, driverstatusimageview, driverstatustextview, statuslinearlayout).execute();             confirm_driver.setonclicklistener(this);             reject_driver.setonclicklistener(this);         } catch (exception e) {             e.printstacktrace();         }         get_driver_location();         return root;     }      private latlongdetails get_driver_location() {         gpstracker = new gpstracker(context);         latlongdetails temp_latlongobj = new latlongdetails();         if (gpstracker.cangetlocation()) {             try {                 temp_latlongobj.driver_latitude = gpstracker.getlocation().getlatitude();                 temp_latlongobj.driver_longitude = gpstracker.getlocation().getlongitude();             } catch (exception e) {                 toast.maketext(context, r.string.gps_not_enabled, toast.length_short).show();                 e.printstacktrace();             }         } else { //          gps.showsettingsalert();             log.d("gps","null in driver activity");         }         return temp_latlongobj;     }      /**      * receiving push messages      */     private final broadcastreceiver mhandlemessagereceiver = new broadcastreceiver() {         @override         public void onreceive(context context, intent intent) {             /*              * flag 1 update driver location server              * flag 2 show              * message driver call customer ride later flag 3              * show ride later booking rejected flag 4 show message              * call customer ride flag 5 show ride              * booking rejected              *              */             string flag = ""                     + intent.getextras()                     .getstring(commonutilities.extra_message).charat(0);             string newmessage = intent.getextras()                     .getstring(commonutilities.extra_message).substring(1);           /*  if (flag.contains("1")) {                 // waking mobile if sleeping                 try {                     wakelocker.acquire(context);                     *//**                      * take appropriate action on message depending upon                      * app requirement displaying on screen                      * *//*                    driver_latlongobj = get_driver_location();                     update_driverlocation(context, newmessage);                     wakelocker.release();                 } catch (exception e) {                     e.printstacktrace();                 }             }*/             if (flag.contains("2")) {                 try {                     int length = newmessage.split("]").length;                     string data[] = new string[length];                     data = newmessage.split("]");                     (int = 0; < data.length; i++) {                         data[i] = data[i].replace("[", "");                         log.e("data" + i, " " + data[i].tostring());                     }                     passengerdetails.passengername = data[0];                     passengerdetails.passengernumber = data[1];                     passengerdetails.passemger_pick_date = data[2];                     passengerdetails.passenger_pick_time = data[3];                     passengerdetails.passenger_pick_loc = data[4];                     passengerdetails.passenger_drop_loc = data[5];                     logindetails.unique_table_id = data[6];                     userdata.setunique_table_id(data[6]);                     passengerdetails.fare = data[7];                     details_layout.setvisibility(view.visible);                     pass_detail_layout.setvisibility(view.visible);                     button_layout.setvisibility(view.visible);                     fare_value.setvisibility(view.visible);                     pick_date_left.setvisibility(view.visible);                     pick_time_left.setvisibility(view.visible);                     pick_date.setvisibility(view.visible);                     pick_time.setvisibility(view.visible);                     pass_name.settext("" + passengerdetails.passengername);                     pass_num.settext("" + passengerdetails.passengernumber);                     pick_loc.settext("" + passengerdetails.passenger_pick_loc);                     drop_loc.settext("" + passengerdetails.passenger_drop_loc);                     pick_date.settext("" + passengerdetails.passemger_pick_date);                     pick_time.settext("" + passengerdetails.passenger_pick_time);                     fare_value.settext(context.getresources().getstring(r.string.currency_sign)+" "+ passengerdetails.fare);                     driverstatusimageview.setimageresource(r.drawable.pending);                     driverstatustextview.settext(r.string.pending_status);                     driverdetails.setdriverstatus("" + getresources().getstring(r.string.pending_status));                     new driverstatusupdate((activity) context).execute();                 } catch (exception e) {                     e.printstacktrace();                 }             }             if (flag.contains("3")) {                 try {                     toast.maketext(context, "" + newmessage, toast.length_short).show();                     pass_detail_layout.setvisibility(view.invisible);                     button_layout.setvisibility(view.invisible);                     details_layout.setvisibility(view.invisible);                     passengerdetails.passengername = "";                     passengerdetails.passengernumber = "";                     passengerdetails.passemger_pick_date = "";                     passengerdetails.passenger_pick_time = "";                     passengerdetails.passenger_pick_loc = "";                     passengerdetails.passenger_drop_loc = "";                     driverstatusimageview.setimageresource(r.drawable.available);                     driverdetails.setdriverstatus("" + getresources().getstring(r.string.available_status));                     driverstatustextview.settext(driverdetails.getdriverstatus());                     new driverstatusupdate((activity) context).execute();                 } catch (exception e) {                     e.printstacktrace();                 }             }             if (flag.contains("4")) {                 try {                     int length = newmessage.split("]").length;                     string data[] = new string[length];                     data = newmessage.split("]");                     (int = 0; < data.length; i++) {                         data[i] = data[i].replace("[", "");                         log.e("data" + i, " " + data[i].tostring());                     }                     passengerdetails.passengername = data[0];                     passengerdetails.passengernumber = data[1];                     passengerdetails.passemger_pick_date = data[2];                     passengerdetails.passenger_pick_time = data[3];                     passengerdetails.passenger_pick_loc = data[4];                     passengerdetails.passenger_drop_loc = data[5];                     logindetails.unique_table_id = data[6];                     userdata.setunique_table_id(data[6]);                     passengerdetails.fare = data[7];                     pass_detail_layout.setvisibility(view.visible);                     button_layout.setvisibility(view.visible);                     pass_name.settext("" + passengerdetails.passengername);                     pass_num.settext("" + passengerdetails.passengernumber);                     pick_loc.settext("" + passengerdetails.passenger_pick_loc);                     drop_loc.settext("" + passengerdetails.passenger_drop_loc);                     pick_date_left.setvisibility(view.visible);                     pick_time_left.setvisibility(view.visible);                     details_layout.setvisibility(view.visible);                     fare_value.setvisibility(view.visible);                     pick_date.setvisibility(view.visible);                     pick_date.settext("" + passengerdetails.passemger_pick_date);                     pick_time.settext("" + passengerdetails.passenger_pick_time);                     fare_value.settext(context.getresources().getstring(r.string.currency_sign)+" "+ passengerdetails.fare);                     pick_time.setvisibility(view.visible);                     driverstatusimageview.setimageresource(r.drawable.pending);                     driverstatustextview.settext(r.string.pending_status);                     driverdetails.setdriverstatus("" + getresources().getstring(r.string.pending));                     new driverstatusupdate((activity) context).execute();                 } catch (exception e) {                     e.printstacktrace();                 }             }             if (flag.contains("5")) {                 try {                     toast.maketext(context, "" + newmessage, toast.length_short)                             .show();                     pass_detail_layout.setvisibility(view.invisible);                     button_layout.setvisibility(view.invisible);                     details_layout.setvisibility(view.invisible);                     passengerdetails.passengername = "";                     passengerdetails.passengernumber = "";                     passengerdetails.passemger_pick_date = "";                     passengerdetails.passenger_pick_time = "";                     passengerdetails.passenger_pick_loc = "";                     passengerdetails.passenger_drop_loc = "";                     driverstatusimageview.setimageresource(r.drawable.available);                     driverdetails.setdriverstatus("" +getresources().getstring(r.string.available_status));                     driverstatustextview.settext(driverdetails.getdriverstatus());                     new driverstatusupdate((activity) context).execute();                 } catch (exception e) {                     e.printstacktrace();                 }             }              if (flag.contains("7")) {                 try {                     toast.maketext(context,""+newmessage,toast.length_long).show();                /* driverstatusimageview.setimageresource(r.drawable.booked);                 driverdetails.setdriverstatus("" + r.string.booked_status);                 driverstatustextview.settext(driverdetails.getdriverstatus());                 new driverstatusupdate((activity) context).execute();                 replacefragment(context, new ridedetailsfragment());*/                 } catch (exception e) {                     e.printstacktrace();                 }             }              if (flag.contains("8")) {                 try {                     driverstatusimageview.setimageresource(r.drawable.booked);                     driverdetails.setdriverstatus("" + r.string.booked_status);                     driverstatustextview.settext(driverdetails.getdriverstatus());                     new driverstatusupdate((activity) context).execute();                     replacefragment(context, new ridedetailsfragment());                 } catch (exception e) {                     e.printstacktrace();                 }             }             if (flag.contains("a")) {                 showdialogbox();             } else {             }         }         /* private void update_driverlocation(context context, string newmessage) {             driver_loc_update_task task = new driver_loc_update_task(context,                     newmessage);             if (newmessage.contains("@")) {                 task.execute();             }         }*/     };      public void makecall() {         try {             phonenumber = "tel:" + passengerdetails.passengernumber;             intent callintent = new intent(intent.action_call, uri.parse(phonenumber));             context.startactivity(callintent);         } catch (securityexception e) {             e.printstacktrace();         }     }      public void showdialogbox() {         alertdialog.builder alertdialogbuilder = new alertdialog.builder(context);         alertdialogbuilder.setmessage(context.getresources().getstring(r.string.cash_payment));         alertdialogbuilder.setpositivebutton("ok",                 new dialoginterface.onclicklistener() {                     @override                     public void onclick(dialoginterface arg0, int arg1) {                     }                 });         alertdialogbuilder.setnegativebutton("cancel",                 new dialoginterface.onclicklistener() {                     @override                     public void onclick(dialoginterface arg0, int arg1) {                     }                 });         alertdialog alertdialog = alertdialogbuilder.create();         alertdialog.show();     }      @override     protected void backpressed() {         try {             if (doublebacktoexitpressedonce) {                 try {                     intent intent = new intent(intent.action_main);                     intent.addcategory(intent.category_home);                     intent.setflags(intent.flag_activity_new_task);                     startactivity(intent);                     system.exit(0);                     ((mainactivity) getactivity()).finish();                     android.os.process.killprocess(android.os.process.mypid());                     super.ondestroy();                 } catch (exception e) {                     e.printstacktrace();                 }                 return;             }             this.doublebacktoexitpressedonce = true;             toast.maketext(context, r.string.tap_again, toast.length_short).show();         } catch (exception e) {             e.printstacktrace();         }     }      @override     public void ondestroy() {        /* if (mregistertask != null) {             mregistertask.cancel(true);         }*/         try {             context.unregisterreceiver(mhandlemessagereceiver);         } catch (exception e) {             log.e("unregister receiver error", "> " + e.getmessage());         }         super.ondestroy();     }      @override     public void onpause() {         super.onpause();     }      @override     public void onresume() {         try {             context.registerreceiver(mhandlemessagereceiver, new intentfilter(                     commonutilities.display_message_action));         } catch (exception e) {             e.printstacktrace();         }         super.onresume();     }      @override     public void onclick(view v) {         switch (v.getid()) {             case r.id.confirm_img_dri:                 driverstatustextview.settext(r.string.booked_status);                 driverstatusimageview.setimageresource(r.drawable.booked);                 button_layout.setvisibility(view.invisible);                 driverdetails.setdriverstatus("" +getresources().getstring(r.string.booked_status));                 new driverstatusupdate(context).execute();                 new confirmrejectcabservice(getactivity(), 1, context)                         .execute(iwebconstant.confirm);                 break;             case r.id.reject_img_dri:                 toast.maketext(context, r.string.please_wait,                         toast.length_short).show();                 details_layout.setvisibility(view.invisible);                 pass_detail_layout.setvisibility(view.invisible);                 button_layout.setvisibility(view.invisible);                 driverstatustextview.settext(r.string.available_status);                 driverstatusimageview.setimageresource(r.drawable.available);                 driverdetails.setdriverstatus("" + getresources().getstring(r.string.available_status));                 new driverstatusupdate(context).execute();                 new confirmrejectcabservice(getactivity(), 1, context).execute(iwebconstant.reject);                 break;             case r.id.imageviewphone:                 makecall();             default:                 break;         }     }      private void setlinearlayoutonclicklistener(final context context,                                                 linearlayout statuslinearlayout,                                                 final imageview driverstatusimageview,                                                 final textview driverstatustextview) {         statuslinearlayout.setonclicklistener(new view.onclicklistener() {             @override             public void onclick(view v) {                 dialog = new dialog(context);                 dialog.requestwindowfeature(window.feature_no_title);                 dialog.setcontentview(r.layout.iamlistspinner);                 dialog.settitle("i .....");                 iam_customlist listadapter = new iam_customlist(                         (activity) context, appconstants.catgories,                         appconstants.imageids);                 list = (listview) dialog.findviewbyid(r.id.iam_listview);                 list.setadapter(listadapter);                 list.setonitemclicklistener(new adapterview.onitemclicklistener() {                     @override                     public void onitemclick(adapterview<?> parent, view view, int position, long id) {                         switch (position) {                             case 0:                                 driverstatustextview.settext(r.string.available_status);                                 driverstatusimageview.setimageresource(r.drawable.available);                                 driverdetails.setdriverstatus("" +getresources().getstring(r.string.available_status));                                 break;                             case 1:                                 driverstatustextview.settext(r.string.booked_status);                                 driverstatusimageview.setimageresource(r.drawable.booked);                                 driverdetails.setdriverstatus("" + getresources().getstring(r.string.booked_status));                                 break;                             case 2:                                 driverstatustextview.settext(r.string.dnd_status);                                 driverstatusimageview.setimageresource(r.drawable.dnd);                                 driverdetails.setdriverstatus("" + getresources().getstring(r.string.dnd_status));                                 break;                         }                         new driverstatusupdate((activity) context).execute("");                         log.e("item clicked @ ", "" + position);                         dialog.dismiss();                     }                 });                 dialog.show();             }         });     } } 

the problem making global variable userdata of type userdata => "private userdata userdata;" , have to following :

1.make sure there class named userdata in package 2. import in driverfragment class 3.check classes have uses userdata class , import in them .


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -