java - How to solve "Unreachable Statement" -


this android code.i have error in below line toast "unreachable statement" , know error come return of if don't know how solve it

error part:

do {     return;     if ((paramanonymous2int == 0) && (androidhtmlactivity.this.count == 4))     {         toast.maketext(getapplicationcontext(),"نسخه رایگان",toast.length_short).show();         return;     } } 

the whole function :

@javascriptinterface     public void savedialog(final string paramstring)     {         final sqlitedatabase mydatabase = openorcreatedatabase("copycollection", mode_private, null);         object localobject = mydatabase.rawquery("select * details id=" + paramstring + ";", null);         if (((cursor)localobject).movetofirst()) {                         {                 androidhtmlactivity.this.appname = ((cursor)localobject).getstring(1);                 androidhtmlactivity.this.txtclip = ((cursor)localobject).getstring(2);                 androidhtmlactivity.this.text_date = ((cursor)localobject).getstring(3);             } while (((cursor)localobject).movetonext());         }         localobject = new alertdialog.builder(androidhtmlactivity.this);         ((alertdialog.builder)localobject).settitle("ذخیره");         ((alertdialog.builder)localobject).setpositivebutton("ذخیره", new dialoginterface.onclicklistener()         {             public void onclick(dialoginterface paramanonymousdialoginterface, int paramanonymousint)             {                 final sqlitedatabase mydatabase1 = openorcreatedatabase("copycollection", mode_private, null);                 cursor crs = mydatabase1.rawquery("select * groups;",null);                 string[] array = new string[crs.getcount()];                 int[] arrayid = new int[crs.getcount()];                 count = crs.getcount();                 int = 0;                 while(crs.movetonext()){                     string uname = crs.getstring(crs.getcolumnindex("groupname"));                     int id = crs.getcolumnindex("id");                     arrayid[i] = id;                     array[i] = uname;                     i++;                 }                 final alertdialog.builder builder = new alertdialog.builder(androidhtmlactivity.this);                 builder.settitle("گروه خود را انتخاب کنید");                 builder.setitems(paramanonymousdialoginterface, new dialoginterface.onclicklistener()                 {                     public void onclick(final dialoginterface paramanonymous2dialoginterface, int paramanonymous2int)                     {                         stri = string.valueof(paramanonymous2int);                         string localobject1 = string.valueof(paramanonymous2int);                         final sqlitedatabase mydatabase = openorcreatedatabase("copycollection", mode_private, null);                         cursor localobject2 = mydatabase.rawquery("select * status id=1;", null);                         if ((localobject2).movetofirst()) {                                                         {                                 androidhtmlactivity.this.trial = (localobject2).getint(1);                             } while ((localobject2).movetonext());                         }                         if ((paramanonymous2int == 0) && (androidhtmlactivity.this.count != 4))                         {                             final alertdialog.builder builder1 = new alertdialog.builder(androidhtmlactivity.this);                             builder1.settitle("درج عنوان گروه");                             final edittext input = new edittext(androidhtmlactivity.this);                             input.setinputtype(1);                             builder1.setview(input);                             builder1.setpositivebutton("تایید", new dialoginterface.onclicklistener()                             {                                 public void onclick(dialoginterface paramanonymous3dialoginterface, int paramanonymous3int)                                 {                                     m_text = input.gettext().tostring();                                     mydatabase.execsql("insert groups (groupname) values('" + m_text + "');");                                     cursor c3 = mydatabase.rawquery("select * groups order id desc limit 1;", null);                                     if ((c3 != null) && (c3.movetofirst()))                                     {                                         long l = c3.getlong(0);                                         lastdir = string.valueof(l);                                     }                                     mydatabase.execsql("insert maincontent(appname,txt,groupid,time)values('" + appname + "','" + txtclip + "','" + lastdir + "','" + text_date + "');");                                     mydatabase.execsql("delete details id = " + paramstring + ";");                                     mydatabase.close();                                 }                             });                             builder1.setnegativebutton("انصراف", new dialoginterface.onclicklistener()                             {                                 public void onclick(dialoginterface paramanonymous3dialoginterface, int paramanonymous3int)                                 {                                     paramanonymous3dialoginterface.cancel();                                     androidhtmlactivity.this.mybrowser.post(new runnable()                                     {                                         public void run()                                         {                                             mybrowser.loadurl("javascript:fill_comment()");                                         }                                     });                                 }                             });                             builder1.show();                         }                                                 {                             return;                             if ((paramanonymous2int == 0) && (androidhtmlactivity.this.count == 4))                             {                                 toast.maketext(getapplicationcontext(),"نسخه رایگان",toast.length_short).show();                                 return;                             }                         }                         while (paramanonymous2int == 0);                         cursor c2 = mydatabase.rawquery("select count(*) `maincontent` `groupid` '" + localobject1 + "'", null);                         (c2).movetofirst();                         if ((c2).getint(0) < 5)                         {                             mydatabase.execsql("insert maincontent (appname,txt,groupid,time) values('" + androidhtmlactivity.this.appname + "','" + androidhtmlactivity.this.txtclip + "','" + (string)localobject1 + "','" + text_date + "');");                             mydatabase.execsql("delete details id = " + paramstring + ";");                             mydatabase.close();                         }                         toast.maketext(getapplicationcontext(),"نسخه رایگان",toast.length_short).show();                         androidhtmlactivity.this.mybrowser.post(new runnable()                         {                             public void run()                             {                                 androidhtmlactivity.this.mybrowser.loadurl("javascript:fill_comment()");                             }                         });                     }                 });                 builder.create().show();             }         });         ((alertdialog.builder)localobject).setnegativebutton("اشتراک گذاری", new dialoginterface.onclicklistener()         {             public void onclick(dialoginterface paramanonymousdialoginterface, int paramanonymousint)             {                 intent intent = new intent("android.intent.action.send");                 intent.settype("text/plain");                 string str = txtclip;                 intent.putextra("android.intent.extra.subject", "subject");                 intent.putextra("android.intent.extra.text", str);                 startactivity(intent.createchooser(intent, "share via"));             }         });         ((alertdialog.builder)localobject).show();     }      @javascriptinterface     public void configuration()     {         intent localintent = new intent(androidhtmlactivity.this, directory.class);         androidhtmlactivity.this.startactivity(localintent);         androidhtmlactivity.this.finish();     } 

look @ code

return; if ((paramanonymous2int == 0) && (androidhtmlactivity.this.count == 4)) 

you return right before validation, hence never reach it.


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

order - Notification for user in user account opencart -