· 6 years ago · Mar 20, 2020, 09:38 AM
1package com.dwidasa.index.mb.android.activity;
2
3import android.app.Activity;
4import android.app.AlertDialog;
5import android.app.Dialog;
6import android.content.Context;
7import android.content.DialogInterface;
8import android.content.Intent;
9import android.content.SharedPreferences;
10import android.content.pm.PackageManager;
11import android.graphics.Color;
12import android.graphics.drawable.ColorDrawable;
13import android.hardware.fingerprint.FingerprintManager;
14import android.os.Build;
15import android.preference.PreferenceManager;
16import android.support.v7.app.AppCompatActivity;
17import android.os.Bundle;
18import android.util.Log;
19import android.view.View;
20import android.view.ViewGroup;
21import android.view.Window;
22import android.widget.Button;
23import android.widget.EditText;
24import android.widget.ImageView;
25import android.widget.LinearLayout;
26import android.widget.TextView;
27
28import com.dwidasa.index.mb.android.BuildConfig;
29import com.dwidasa.index.mb.android.R;
30import com.dwidasa.index.mb.android.activity.activation.NewActivationActivity;
31import com.dwidasa.index.mb.android.activity.base.BaseActivity;
32import com.dwidasa.index.mb.android.activity.call.CallActivity;
33import com.dwidasa.index.mb.android.activity.information.LocationActivity;
34import com.dwidasa.index.mb.android.activity.registration.RegistrationActivity;
35import com.dwidasa.index.mb.android.activity.token.LoginSoftTokenActivity;
36import com.dwidasa.index.mb.android.adapter.database.UserDbAdapter;
37import com.dwidasa.index.mb.android.component.CustomDialogClass2;
38import com.dwidasa.index.mb.android.global.GlobalVar;
39import com.dwidasa.index.mb.android.model.User;
40import com.dwidasa.index.mb.android.restful.AsyncTaskCompleteListener;
41import com.dwidasa.index.mb.android.restful.CallService;
42import com.dwidasa.index.mb.android.util.Constant;
43import com.dwidasa.index.mb.android.util.FontUtils;
44import com.dwidasa.index.mb.android.util.ResponseMessage;
45import com.dwidasa.index.mb.android.util.StringUtil;
46import com.dwidasa.index.mb.android.util.Utility;
47import com.dwidasa.otp.aes.AesCrypto;
48import com.multidots.fingerprintauth.AuthErrorCodes;
49import com.multidots.fingerprintauth.FingerPrintAuthCallback;
50import com.multidots.fingerprintauth.FingerPrintAuthHelper;
51import com.multidots.fingerprintauth.FingerPrintUtils;
52
53import org.apache.http.NameValuePair;
54import org.apache.http.client.entity.UrlEncodedFormEntity;
55import org.apache.http.message.BasicNameValuePair;
56import org.json.JSONException;
57import org.json.JSONObject;
58
59import java.io.UnsupportedEncodingException;
60import java.util.ArrayList;
61import java.util.List;
62
63public class NewLoginActivity extends BaseActivity implements View.OnClickListener, AsyncTaskCompleteListener<Object>,FingerPrintAuthCallback {
64 private int selectedButton, choice;
65 private EditText userid, password;
66 private TextView tvLanguage, tvAktivasi;
67 private TextView tvVersion;
68 private static final int REQUEST_CHANGE_LANGUAGE = 10;
69 private Intent intent;
70 private User user;
71 private static final int NEXT = 123;
72 private Button fingerBtn;
73 private String Username;
74
75 private boolean finger=true;
76 private Dialog dialog;
77 public FingerPrintAuthHelper mFingerPrintAuthHelper;
78 private int cancelFinger=0;
79 private String countFinger;
80
81 @Override
82 protected void onCreate(Bundle savedInstanceState) {
83 super.onCreate(savedInstanceState);
84 setContentView(R.layout.activity_new_login);
85 initializeComponent();
86 UserDbAdapter dbAdapter = new UserDbAdapter(this); //
87 user = dbAdapter.getRecord(); //
88 SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
89 String name = sp.getString("x100vb", "test");
90
91 String username = AesCrypto.decrypt("28xn", name);
92 Username = username;
93
94 LinearLayout viewExtraLayout = (LinearLayout) findViewById(R.id.viewExtraLayout);
95 tvVersion = (TextView) findViewById(R.id.tvVersion);
96 tvAktivasi = (TextView) findViewById(R.id.tvAktivasi);
97 //Button softBtn = (Button) findViewById(R.id.softBtn);
98 //softBtn.setOnClickListener(this);
99 if(user.getCustomerUserId() == null) {
100 //softBtn.setVisibility(Button.GONE);
101 viewExtraLayout.setVisibility(LinearLayout.GONE);
102 tvAktivasi.setVisibility(View.VISIBLE);
103 } else {
104 LinearLayout softBtn = (LinearLayout) findViewById(R.id.layoutButtonSoft);
105 softBtn.setOnClickListener(this);
106
107 LinearLayout callBtn = (LinearLayout) findViewById(R.id.layoutButtonCall);
108 callBtn.setOnClickListener(this);
109
110 LinearLayout locationBtn = (LinearLayout) findViewById(R.id.layoutButtonLocation);
111 locationBtn.setOnClickListener(this);
112
113 tvAktivasi.setVisibility(View.GONE);
114 }
115 countFinger = sp.getString("countFinger", "1");
116 System.out.println("MASUK ISI countFinger di Login " + countFinger);
117
118 if (countFinger == "1" || countFinger.equals("1")){
119 System.out.println("MASUK VISIBLE FINGERPRINT");
120 fingerBtn.setVisibility(View.VISIBLE);
121 }
122 tvVersion.setText("V." + String.valueOf(BuildConfig.VERSION_NAME));
123 tvAktivasi.setOnClickListener(this);
124 }
125
126 private void initializeComponent() {
127 // TODO Auto-generated method stub
128 ImageView settingsButton = (ImageView) findViewById(R.id.settingsButton);
129 settingsButton.setOnClickListener(this);
130
131 userid = (EditText) findViewById(R.id.userIdText);
132 tvLanguage = (TextView) findViewById(R.id.tvLanguage);
133
134 userid.setTypeface(FontUtils.loadFontFromAssets(this, Constant.FONT_PLAIN));
135
136 password = (EditText) findViewById(R.id.passwordText);
137 password.setTypeface(FontUtils.loadFontFromAssets(this, Constant.FONT_PLAIN));
138
139 Button loginBtn = (Button) findViewById(R.id.loginBtn);
140 loginBtn.setOnClickListener(this);
141 loginBtn.setTypeface(FontUtils.loadFontFromAssets(this, Constant.FONT_BOLD));
142
143 fingerBtn = (Button) findViewById(R.id.fingerBtn);
144 fingerBtn.setOnClickListener(this);
145
146
147 }
148
149 @Override
150 public void onClick(View v) {
151 // TODO Auto-generated method stub
152 if (v.getId() == R.id.loginBtn) {
153 selectedButton = R.id.loginBtn;
154 choice = 123;
155
156 if (isValidInput(userid.getText().toString(), password.getText().toString())) {
157
158 /*Intent intent = new Intent(LoginActivity.this, RequestActivationCodeActivity.class);
159 intent.putExtra("username", userid.getText().toString().trim());
160 intent.putExtra("password", password.getText().toString().trim());
161 startActivity(intent);*/
162
163 String tokenId = Utility.getTokenId(this);
164 StringBuilder url = new StringBuilder().append(Constant.BASE_URL);
165
166
167 url.append("authentication/authenticateCheckPost");
168
169 try {
170 //int currentVersionId = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode;
171 List<NameValuePair> nvp = new ArrayList<NameValuePair>();
172 if (user.getCustomerUserId() != null) {
173 nvp.add(new BasicNameValuePair("customerId", user.getCustomerUserId().toString()));
174 }
175 //
176 nvp.add(new BasicNameValuePair("username", userid.getText().toString().toUpperCase()));
177 nvp.add(new BasicNameValuePair("password", password.getText().toString()));
178 //nvp.add(new BasicNameValuePair("versionId",String.valueOf(currentVersionId)));
179 nvp.add(new BasicNameValuePair("deviceId", tokenId));
180 UrlEncodedFormEntity ufe = new UrlEncodedFormEntity(nvp);
181
182 if (Constant.SHOW_LOG)
183 Log.i("", "========== login " + url + " === " + nvp.toString());
184 final CallService task = new CallService(NewLoginActivity.this, this);
185 task.execute(url.toString(), Constant.REST_POST, ufe);
186
187 } catch (UnsupportedEncodingException e) {
188 // TODO Auto-generated catch block
189 e.printStackTrace();
190 } /*catch (NameNotFoundException e) {
191 // TODO Auto-generated catch block
192 e.printStackTrace();
193 } */
194 }
195
196 } else if (v.getId() == R.id.settingsButton) {
197 Intent intent = new Intent(this, ChangeLanguageActivity.class);
198 startActivityForResult(intent, REQUEST_CHANGE_LANGUAGE);
199 } else if (v.getId() == R.id.layoutButtonSoft) {
200 Intent intent = new Intent(NewLoginActivity.this, LoginSoftTokenActivity.class);
201 intent.putExtra("tokenType", Constant.TOKEN_TYPE_CHALLENGE);
202 startActivity(intent);
203 } else if (v.getId() == R.id.layoutButtonCall) {
204 Intent intent = new Intent(NewLoginActivity.this, CallActivity.class);
205 startActivity(intent);
206 } else if (v.getId() == R.id.layoutButtonLocation) {
207 Intent intent = new Intent(NewLoginActivity.this, LocationActivity.class);
208 intent.putExtra("from", this.getClass().getName());
209 intent.putExtra("locationType", 1);
210 startActivity(intent);
211 } else if (v == tvAktivasi) {
212 Intent intent = new Intent(NewLoginActivity.this, EulaActivity.class);
213 intent.putExtra("destination", NewActivationActivity.class.getName());
214 startActivity(intent);
215 } else if (v.getId() == R.id.fingerBtn) {
216 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
217 //Fingerprint API only available on from Android 6.0 (M)
218 FingerprintManager fingerprintManager = (FingerprintManager) getSystemService(Context.FINGERPRINT_SERVICE);
219 if (!fingerprintManager.isHardwareDetected()) {
220 // Device doesn't support fingerprint authentication
221 new AlertDialog.Builder(NewLoginActivity.this)
222 .setTitle(getString(R.string.header_message))
223 .setMessage(getString(R.string.finger_error4))
224 .setNeutralButton(getString(R.string.button_tutup), null).show();
225 } else if (!fingerprintManager.hasEnrolledFingerprints()) {
226 // User hasn't enrolled any fingerprints to authenticate with
227 final CustomDialogClass2 cd = new CustomDialogClass2(NewLoginActivity.this);
228 cd.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
229 cd.show();
230 cd.isi.setText(getString(R.string.finger_error3));
231 cd.yes.setText(getString(R.string.open_setting));
232 cd.yes.setOnClickListener(new View.OnClickListener() {
233 @Override
234 public void onClick(View v) {
235 FingerPrintUtils.openSecuritySettings(NewLoginActivity.this);
236 }
237 });
238 } else {
239 mFingerPrintAuthHelper = FingerPrintAuthHelper.getHelper(NewLoginActivity.this, NewLoginActivity.this);
240 if (mFingerPrintAuthHelper != null) {
241 mFingerPrintAuthHelper.startAuth();
242 }
243 // custom dialog
244
245 dialog = new Dialog(this);
246 dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
247 dialog.setContentView(R.layout.dialog_fingerprint);
248 dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
249 dialog.setCanceledOnTouchOutside(false);
250
251 cancelFinger = 0;
252
253 Button dialogButton = (Button) dialog.findViewById(R.id.CloseBtn);
254 dialogButton.setOnClickListener(new View.OnClickListener() {
255 @Override
256 public void onClick(View v) {
257 cancelFinger = 1;
258 mFingerPrintAuthHelper.stopAuth();
259 dialog.dismiss();
260 }
261 });
262
263 if (!finger) {
264
265 } else {
266 dialog.show();
267 }
268 }
269 }
270 } else {
271 new AlertDialog.Builder(NewLoginActivity.this)
272 .setTitle(getString(R.string.header_message))
273 .setMessage(getString(R.string.finger_error4))
274 .setNeutralButton(getString(R.string.button_tutup), null).show();
275 }
276 }
277
278 private void gotoRegistration(){
279 Intent intent = new Intent(NewLoginActivity.this, RegistrationActivity.class);
280 startActivity(intent);
281 }
282
283 private void gotoActivationAccount(){
284 //goto intent aktivasi berhasil
285 //Intent intent = new Intent(LoginActivity.this, ActivationAccountActivity.class);
286 //intent.putExtra(Constant.LOGIN_AKTIVASI, "1");
287 Intent intent = new Intent(NewLoginActivity.this, NewActivationActivity.class);
288 startActivityForResult(intent, NEXT);
289 }
290 private boolean isValidInput(String username, String password) {
291
292 if (StringUtil.isBlank(username)){
293 new AlertDialog.Builder(this)
294 .setTitle(getString(R.string.header_message))
295 .setMessage(getString(R.string.error_empty_userid_login))
296 .setNeutralButton("Tutup", null).show();
297 return false;
298 }else if (StringUtil.isBlank(password)){
299 new AlertDialog.Builder(this)
300 .setTitle(getString(R.string.header_message))
301 .setMessage(getString(R.string.error_empty_password_login))
302 .setNeutralButton("Tutup", null).show();
303 return false;
304 }
305
306 return true;
307 }
308 private void fingerprint() {
309
310 String tokenId = Utility.getTokenId(this);
311 StringBuilder url = new StringBuilder().append(Constant.BASE_URL);
312
313 url.append("authentication/biometricAuthenticationPost");
314
315 try {
316 String key = Utility.generateMd5(user.getCustomerUserId().toString() + tokenId.substring(0, 5));
317 String encryptedUsername = AesCrypto.encrypt(key, Username);
318
319 List<NameValuePair> nvp = new ArrayList<NameValuePair>();
320 nvp.add(new BasicNameValuePair("customerId", user.getCustomerUserId().toString()));
321 nvp.add(new BasicNameValuePair("deviceId", tokenId));
322 nvp.add(new BasicNameValuePair("username", encryptedUsername));
323
324 UrlEncodedFormEntity ufe = new UrlEncodedFormEntity(nvp);
325 if (Constant.LOG_AKTIF) {
326 Log.i("LOGIN FINGERPRINT", "========== login " + url + " === " + nvp.toString());
327 }
328
329 final CallService task = new CallService(NewLoginActivity.this, this);
330 task.execute(url.toString(), Constant.REST_POST, ufe);
331
332 } catch (UnsupportedEncodingException e) {
333 // TODO Auto-generated catch block
334 if (Constant.LOG_AKTIF) {
335 e.printStackTrace();
336 }
337 }
338 }
339
340 @Override
341 public void onTaskComplete(Object... params) {
342 String result = (String) params[0];
343 Log.e("REST RESULT", result);
344 if(Utility.cekValidResultActivation(result, this)){
345 if (selectedButton == R.id.loginBtn) {
346 if(choice == 123) {
347 try {
348 JSONObject jsonObject = new JSONObject(result);
349
350 if(jsonObject.has("errorCode")){
351 if(user.getCustomerUserId() != null){
352 String message = (jsonObject.has("fullMessage"))?jsonObject.getString("fullMessage"): ResponseMessage
353 .getResponseMessage(this, jsonObject.getString("errorCode"));
354 new AlertDialog.Builder(this)
355 .setTitle(getString(R.string.header_message))
356 .setMessage(message)
357 .setNeutralButton(getString(R.string.button_tutup), null)
358 .show();
359 }else {
360 Log.e("ENTER", "1");
361 Intent intent = new Intent(NewLoginActivity.this, EulaActivity.class);
362 //Intent intent = new Intent(LoginActivity.this, RequestActivationCodeActivity.class);
363 intent.putExtra("username", userid.getText().toString().trim().toUpperCase());
364 intent.putExtra("password", password.getText().toString().trim());
365 startActivity(intent);
366 }
367 } else {
368 choice = 456;
369 if(user.getCustomerUserId() == null) {
370 Log.e("ENTER", "2");
371 Intent intent = new Intent(NewLoginActivity.this, EulaActivity.class);
372 //Intent intent = new Intent(LoginActivity.this, RequestActivationCodeActivity.class);
373 intent.putExtra("username", userid.getText().toString().trim().toUpperCase());
374 intent.putExtra("password", password.getText().toString().trim());
375 startActivity(intent);
376 } else {
377 Log.e("ENTER", "3");
378 String tokenId = Utility.getTokenId(this);
379 StringBuilder url = new StringBuilder().append(Constant.BASE_URL);
380
381 url.append("authentication/authenticatePost");
382
383 try {
384 int currentVersionId = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode;
385 List<NameValuePair> nvp = new ArrayList<NameValuePair>();
386 if(user.getCustomerUserId() != null) {
387 nvp.add(new BasicNameValuePair("customerId",user.getCustomerUserId().toString()));
388 }
389 //nvp.add(new BasicNameValuePair("customerId",(user.getCustomerUserId() == null)? null:""+user.getCustomerUserId())); //
390 nvp.add(new BasicNameValuePair("username",userid.getText().toString().toUpperCase()));
391 nvp.add(new BasicNameValuePair("password",password.getText().toString()));
392 nvp.add(new BasicNameValuePair("versionId",String.valueOf(currentVersionId)));
393 nvp.add(new BasicNameValuePair("deviceId",tokenId));
394 UrlEncodedFormEntity ufe = new UrlEncodedFormEntity(nvp);
395
396 Log.i("", "========== login " + url + " === " + nvp.toString());
397 final CallService task = new CallService(NewLoginActivity.this, this);
398 task.execute(url.toString(), Constant.REST_POST, ufe);
399
400 } catch (UnsupportedEncodingException e) {
401 // TODO Auto-generated catch block
402 e.printStackTrace();
403 } catch (PackageManager.NameNotFoundException e) {
404 // TODO Auto-generated catch block
405 e.printStackTrace();
406 }
407 }
408 }
409 } catch (JSONException e1) {
410 // TODO Auto-generated catch block
411 e1.printStackTrace();
412 }
413 } else {
414 //UserDbAdapter dbAdapter = new UserDbAdapter(this); //
415 //user = dbAdapter.getRecord(); //
416
417 intent = new Intent(NewLoginActivity.this, PortfolioActivity.class);
418
419 try {
420 JSONObject obj = new JSONObject(result);
421 String sessionId = obj.getString("sessionId");
422 String portfolioList = obj.getString("portfolioList");
423 GlobalVar.getInstance().setSessionId(sessionId);
424 GlobalVar.getInstance().setCustomerId(user.getCustomerUserId());
425 GlobalVar.getInstance().setSecretKey(user.getSecretKey());
426 intent.putExtra(Constant.REST_RESULT, portfolioList);
427 intent.setFlags(Intent. FLAG_ACTIVITY_CLEAR_TOP);
428 startActivity(intent);
429 finish();
430 } catch (JSONException e) {
431 e.printStackTrace();
432 }
433 }
434
435
436 userid.setText("");
437 userid.requestFocus();
438 password.setText("");
439 } else {
440
441 }
442 }
443 }
444
445
446 @Override
447 protected void onResume() {
448 super.onResume();
449 SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this);
450 String lang = settings.getString("pref_locale", "en");
451 if(lang.equals("in")){
452 tvLanguage.setText("IND");
453 }else {
454 tvLanguage.setText("EN");
455 }
456 }
457
458 long pauseTime = System.currentTimeMillis();
459
460 @Override
461 protected void onPause() {
462 super.onPause();
463 pauseTime = System.currentTimeMillis();
464 }
465
466 public static void logoutOrExit(Context applicationContext, boolean isLogout, List<Context> list){
467 if (list != null) {
468 for (Context context : list) {
469 ((Activity) context).finish();
470 }
471 }
472 }
473
474 @Override
475 public void onBackPressed() {
476 logoutOrExit(this, true, GlobalVar.getInstance().getAppContexts());
477 this.finish();
478 }
479
480
481 @Override
482 protected void onActivityResult(int requestCode, int resultCode, Intent data) {
483 super.onActivityResult(requestCode, resultCode, data);
484 if (resultCode == RESULT_OK)
485 if (requestCode == REQUEST_CHANGE_LANGUAGE || requestCode == NEXT) {
486 Intent intent = getIntent();
487 intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
488 startActivity(intent);
489 finish();
490 }
491 }
492
493 @Override
494 public void onNoFingerPrintHardwareFound() {
495 finger =false;
496 android.support.v7.app.AlertDialog.Builder builder = new android.support.v7.app.AlertDialog.Builder(NewLoginActivity.this);
497 builder.setTitle(getResources().getString(R.string.header_message));
498 builder.setMessage(getResources().getString(R.string.nofingerprint));
499 builder.setPositiveButton("OK", null);
500 builder.show();
501 }
502
503 @Override
504 public void onNoFingerPrintRegistered() {
505 finger=false;
506 android.support.v7.app.AlertDialog.Builder builder = new android.support.v7.app.AlertDialog.Builder(NewLoginActivity.this);
507 builder.setTitle(getResources().getString(R.string.header_message));
508 builder.setMessage(getResources().getString(R.string.fingernoregister));
509 builder.setPositiveButton("OK", null);
510 builder.show();
511 }
512
513 @Override
514 public void onBelowMarshmallow() {
515 finger=false;
516 android.support.v7.app.AlertDialog.Builder builder = new android.support.v7.app.AlertDialog.Builder(NewLoginActivity.this);
517 builder.setTitle(getResources().getString(R.string.header_message));
518 builder.setMessage(getResources().getString(R.string.oldfinger));
519 builder.setPositiveButton("OK", null);
520 builder.show();
521 }
522
523 @Override
524 public void onAuthSuccess(FingerprintManager.CryptoObject cryptoObject) {
525 dialog.dismiss();
526// if (GlobalVar.getInstance().getLoginTrue()){
527
528 if(countFinger.equals("1")) {
529 dialog.dismiss();
530
531 finger = true;
532
533 fingerprint();
534
535 } else { // blum setting
536
537 }
538
539// }else {
540//
541// }
542
543 }
544
545
546 @Override
547 public void onAuthFailed(int errorCode, String errorMessage) {
548 mFingerPrintAuthHelper.stopAuth();
549 dialog.dismiss();
550 /* if (errorCode == AuthErrorCodes.CANNOT_RECOGNIZE_ERROR || errorCode == AuthErrorCodes.NON_RECOVERABLE_ERROR
551 || errorCode == AuthErrorCodes.RECOVERABLE_ERROR){
552 // System.out.println("MASUK ERROR RECOVERABLE");
553 finger=true;
554 android.support.v7.app.AlertDialog.Builder builder = new android.support.v7.app.AlertDialog.Builder(getContext(), R.style.MyAlertDialogStyle);
555 builder.setTitle(getResources().getString(R.string.message));
556 builder.setMessage(getResources().getString(R.string.CannotInitialize));
557 builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
558 @Override
559 public void onClick(DialogInterface dialog, int which) {
560 // System.out.println("STOP AUTH 2");
561
562 }
563 });
564 if (cancelFinger==1){
565
566 }
567 if (cancelFinger==0){
568 builder.show();
569 }
570
571 }*/
572
573 switch (errorCode) {
574
575
576 case AuthErrorCodes.CANNOT_RECOGNIZE_ERROR:
577 // System.out.println("MASUK ERROR RECOGNIZE");
578 finger=true;
579 android.support.v7.app.AlertDialog.Builder builder = new android.support.v7.app.AlertDialog.Builder(NewLoginActivity.this);
580 builder.setTitle(getResources().getString(R.string.header_message));
581 builder.setMessage(getResources().getString(R.string.CannotRecognize));
582 builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
583 @Override
584 public void onClick(DialogInterface dialog, int which) {
585 System.out.println("STOP AUTH 1");
586
587 }
588 });
589 //builder.show();
590 break;
591 case AuthErrorCodes.NON_RECOVERABLE_ERROR:
592 // System.out.println("MASUK ERROR RECOVERABLE");
593 finger=true;
594 builder = new android.support.v7.app.AlertDialog.Builder(NewLoginActivity.this);
595 builder.setTitle(getResources().getString(R.string.header_message));
596 builder.setMessage(getResources().getString(R.string.CannotInitialize));
597 builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
598 @Override
599 public void onClick(DialogInterface dialog, int which) {
600 // System.out.println("STOP AUTH 2");
601
602 }
603 });
604// if (cancelFinger==1){
605//
606// }
607// if (cancelFinger==0){
608// builder.show();
609// }
610
611 break;
612 case AuthErrorCodes.RECOVERABLE_ERROR:
613 // System.out.println("MASUK ERROR RECOVERABLE 2");
614 finger=true;
615 builder = new android.support.v7.app.AlertDialog.Builder(NewLoginActivity.this);
616 builder.setTitle(getResources().getString(R.string.header_message));
617 builder.setMessage(errorMessage);
618 builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
619 @Override
620 public void onClick(DialogInterface dialog, int which) {
621
622 }
623 });
624 // builder.show();
625 break;
626 }
627 }
628}