Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update TermsAndConditionsActivity.java #71

Merged
merged 1 commit into from
Aug 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}
}
}
Loading