Note that there are some explanatory texts on larger screens.

plurals
  1. POIs it possible to split code in two class files?
    primarykey
    data
    text
    <p>I have a project in which i want to implement around 6000 else if statements , but the problem is i am getting errors in my class file.</p> <p>here are some screenshots of the errors i get error 1 <a href="http://pho.to/4I2Zh" rel="nofollow">http://pho.to/4I2Zh</a></p> <p>error 2 <a href="http://pho.to/4I2c8" rel="nofollow">http://pho.to/4I2c8</a></p> <p>is there a way to split or divide my else-if statements in two classes? or call them from xml file?</p> <p>here is my class file </p> <pre><code> public class WebViewActivity extends Activity { WebView web; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_web_view); web = (WebView) findViewById(R.id.webView1); web.setWebViewClient(new myWebClient()); web.getSettings().setJavaScriptEnabled(true); int pos = getIntent().getIntExtra("key",0); if(pos==0) { web.loadUrl("file:///android_asset/1work1.html"); } else if(pos==1) { web.loadUrl("file:///android_asset/work1.html"); } else if(pos==2) { web.loadUrl("file:///android_asset/work2.html"); } else if(pos==3) { web.loadUrl("file:///android_asset/work3.html"); } // similarly for 4 and 5 and so on. } public class myWebClient extends WebViewClient { @Override public void onPageStarted(WebView view, String url, Bitmap favicon) { // TODO Auto-generated method stub super.onPageStarted(view, url, favicon); } @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { // TODO Auto-generated method stub view.loadUrl(url); return true; } @Override public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { } @Override public void onPageFinished(WebView view, String url) { // TODO Auto-generated method stub super.onPageFinished(view, url); } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload