Commits

Luke Plant committed 0acb7b1

Refactored some constants

  • Participants
  • Parent commits 9a073bf

Comments (0)

Files changed (1)

File src/net/learnscripture/webviewapp/Dashboard.java

  */
 public class Dashboard extends Activity {
 
+	public String BASE_URL = "http://learnscripture.net/";
+	public String DASHBOARD_URL = BASE_URL + "dashboard/";
 
 	@SuppressLint("SetJavaScriptEnabled") @Override
 	protected void onCreate(Bundle savedInstanceState) {
 			}
 		});
 		engine.getSettings().setJavaScriptEnabled(true);
-
-		engine.loadUrl("http://learnscripture.net/");
+		engine.loadUrl(BASE_URL);
 	}
 
 	private WebView getEngine() {
 	public void onBackPressed() {
 		WebView engine = getEngine();
 		String url = engine.getUrl(); 
-		if (url.equals("http://learnscripture.net/") ||
-				url.equals("http://learnscripture.net/dashboard/") ||
+		if (url.equals(BASE_URL) ||
+				url.equals(DASHBOARD_URL) ||
 				!engine.canGoBack()) {
 			// exit
 			super.onBackPressed();
 		// Handle item selection
 		switch (item.getItemId()) {
 		case R.id.dashboard_menuitem:
-			getEngine().loadUrl("http://learnscripture.net/dashboard/");
+			getEngine().loadUrl(DASHBOARD_URL);
 			return true;
 		case R.id.refresh_menuitem:
 			getEngine().reload();