diff --git a/app/src/main/java/com/BugBazaar/ui/TermsAndConditionsActivity.java b/app/src/main/java/com/BugBazaar/ui/TermsAndConditionsActivity.java index 7f5d691..b1d65f7 100644 --- a/app/src/main/java/com/BugBazaar/ui/TermsAndConditionsActivity.java +++ b/app/src/main/java/com/BugBazaar/ui/TermsAndConditionsActivity.java @@ -34,20 +34,21 @@ protected void onCreate(Bundle savedInstanceState) { //Toolbar title set TextView toolbarTitle = findViewById(R.id.toolbarTitle); toolbarTitle.setText("Terms & Conditions"); - + sessionManager = new SessionManager(getApplicationContext()); + setupwebview(webView); if (getIntent().getExtras() != null) { if (getIntent().hasExtra(AppConstants.KEY_WEBVIEW_URL)) { this.webViewUrl = getIntent().getExtras().getString(AppConstants.KEY_WEBVIEW_URL); startWebView(this.webViewUrl); } - } + } else { startdefaultwebview(AppConstants.Terms_Conditions_URL); } -} + } private void startdefaultwebview(String terms_conditions_url) { @@ -71,7 +72,7 @@ private void startWebView(String webViewUrl) { else if (webViewUrl.endsWith(".bugbazaar.com")){ CookieManager cookieManager = CookieManager.getInstance(); cookieManager.setCookie(webViewUrl, getsessionid()); - //Log.d("hello","cookieset"); + //Log.d("hello","cookieset"); } webView.loadUrl(webViewUrl); @@ -95,7 +96,7 @@ public String showToast(String message) { @android.webkit.JavascriptInterface public String gettoken(){ - return String.valueOf(UUID.randomUUID()); + return sessionManager.getUserToken(); } @android.webkit.JavascriptInterface @@ -115,4 +116,4 @@ public String getpassword(){ public void onBackButtonClick(View view) { onBackPressed(); // Navigate back to the previous activity } -} \ No newline at end of file +}