Skip to content

Commit

Permalink
Update TermsAndConditionsActivity.java
Browse files Browse the repository at this point in the history
Missing Initialization of SessionManager Class
  • Loading branch information
banditAmit authored Aug 3, 2024
1 parent b05be6e commit e75bd80
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand All @@ -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);
Expand All @@ -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
Expand All @@ -115,4 +116,4 @@ public String getpassword(){
public void onBackButtonClick(View view) {
onBackPressed(); // Navigate back to the previous activity
}
}
}

0 comments on commit e75bd80

Please sign in to comment.