|
@@ -112,6 +112,26 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
|
|
super.onCreate(savedInstanceState);
|
|
super.onCreate(savedInstanceState);
|
|
setContentView(R.layout.activity_main);
|
|
setContentView(R.layout.activity_main);
|
|
|
|
|
|
|
|
+ /* invoke toolbar */
|
|
|
|
+ Toolbar toolbar = findViewById(R.id.toolbar);
|
|
|
|
+ setSupportActionBar(toolbar);
|
|
|
|
+
|
|
|
|
+ /* invoke drawer */
|
|
|
|
+ DrawerLayout drawer = findViewById(drawer_layout);
|
|
|
|
+ NavigationView navigationView = findViewById(R.id.nav_view);
|
|
|
|
+ View headerView = navigationView.getHeaderView(0);
|
|
|
|
+ /*
|
|
|
|
+ Passing each menu ID as a set of Ids because each
|
|
|
|
+ menu should be considered as top level destinations.
|
|
|
|
+ */
|
|
|
|
+ mAppBarConfiguration = new AppBarConfiguration.Builder(
|
|
|
|
+ R.id.nav_home, R.id.nav_gallery, R.id.nav_slideshow, R.id.nav_archive, R.id.nav_spam)
|
|
|
|
+ .setDrawerLayout(drawer)
|
|
|
|
+ .build();
|
|
|
|
+ NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
|
|
|
|
+ NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration);
|
|
|
|
+ NavigationUI.setupWithNavController(navigationView, navController);
|
|
|
|
+
|
|
/* show account manager when clicking on profile */
|
|
/* show account manager when clicking on profile */
|
|
View accountView = findViewById(R.id.accountView);
|
|
View accountView = findViewById(R.id.accountView);
|
|
accountView.setOnClickListener(new View.OnClickListener() {
|
|
accountView.setOnClickListener(new View.OnClickListener() {
|
|
@@ -127,7 +147,6 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
|
|
/* get string data for drop down menu */
|
|
/* get string data for drop down menu */
|
|
SharedPreferences credReader = getSharedPreferences("Credentials", Context.MODE_PRIVATE);
|
|
SharedPreferences credReader = getSharedPreferences("Credentials", Context.MODE_PRIVATE);
|
|
String currentUser = credReader.getString("currentUser", "");
|
|
String currentUser = credReader.getString("currentUser", "");
|
|
- SharedPreferences.Editor credEditor = credReader.edit();
|
|
|
|
|
|
|
|
TextView showCurrentUserObject = (TextView) accountManagerView.findViewById(R.id.showCurrentUser);
|
|
TextView showCurrentUserObject = (TextView) accountManagerView.findViewById(R.id.showCurrentUser);
|
|
Button switchAccountObject = (Button) accountManagerView.findViewById(R.id.switchToAccountButton);
|
|
Button switchAccountObject = (Button) accountManagerView.findViewById(R.id.switchToAccountButton);
|
|
@@ -135,8 +154,13 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
|
|
Button changeServerSettingsObject = (Button) accountManagerView.findViewById(R.id.changeServerSettingsButton);
|
|
Button changeServerSettingsObject = (Button) accountManagerView.findViewById(R.id.changeServerSettingsButton);
|
|
Button exit = (Button) accountManagerView.findViewById(R.id.exitButton);
|
|
Button exit = (Button) accountManagerView.findViewById(R.id.exitButton);
|
|
|
|
|
|
- showCurrentUserObject.setText(String.format("current user:\n%s", currentUser));
|
|
|
|
|
|
+ if (currentUser == null) {
|
|
|
|
+ showCurrentUserObject.setText("current user:\nNone");
|
|
|
|
+ } else {
|
|
|
|
+ showCurrentUserObject.setText(String.format("current user:\n%s", currentUser));
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ SharedPreferences.Editor credEditor = credReader.edit();
|
|
|
|
|
|
Gson gson = new Gson();
|
|
Gson gson = new Gson();
|
|
|
|
|
|
@@ -145,71 +169,113 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
|
|
}.getType();
|
|
}.getType();
|
|
ArrayList<MailServerCredentials> currentUsersCredentials = gson.fromJson(jsonCredData, credentialsType);
|
|
ArrayList<MailServerCredentials> currentUsersCredentials = gson.fromJson(jsonCredData, credentialsType);
|
|
String[] userArray = new String[0];
|
|
String[] userArray = new String[0];
|
|
- if (!currentUsersCredentials.isEmpty()) {
|
|
|
|
- userArray = new String[currentUsersCredentials.size()];
|
|
|
|
- for (int i = 0; i < currentUsersCredentials.size(); i++) {
|
|
|
|
- userArray[i] = currentUsersCredentials.get(i).getUsername();
|
|
|
|
|
|
+ try {
|
|
|
|
+ if (!currentUsersCredentials.isEmpty()) {
|
|
|
|
+ userArray = new String[currentUsersCredentials.size()];
|
|
|
|
+ for (int i = 0; i < currentUsersCredentials.size(); i++) {
|
|
|
|
+ userArray[i] = currentUsersCredentials.get(i).getUsername();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ } catch (NullPointerException ignored) {}
|
|
|
|
|
|
- //String[] dummyMails = getResources().getStringArray(R.array.dummy_emails);
|
|
|
|
ArrayAdapter<String> dropDownAdapter = new ArrayAdapter<String>(getApplicationContext(), R.layout.dropdown_item,
|
|
ArrayAdapter<String> dropDownAdapter = new ArrayAdapter<String>(getApplicationContext(), R.layout.dropdown_item,
|
|
R.id.textViewDropDownItem, userArray);
|
|
R.id.textViewDropDownItem, userArray);
|
|
accountSelectorObject.setAdapter(dropDownAdapter);
|
|
accountSelectorObject.setAdapter(dropDownAdapter);
|
|
|
|
|
|
/* open dialog */
|
|
/* open dialog */
|
|
dialogBuilder.setView(accountManagerView);
|
|
dialogBuilder.setView(accountManagerView);
|
|
- dialog = dialogBuilder.create();
|
|
|
|
- dialog.show();
|
|
|
|
|
|
+ AlertDialog rootAccountManagerDialog = dialogBuilder.create();
|
|
|
|
+ rootAccountManagerDialog.show();
|
|
|
|
|
|
switchAccountObject.setOnClickListener(new View.OnClickListener() {
|
|
switchAccountObject.setOnClickListener(new View.OnClickListener() {
|
|
@Override
|
|
@Override
|
|
public void onClick(View view) {
|
|
public void onClick(View view) {
|
|
- Gson gson = new Gson();
|
|
|
|
|
|
+ String userInput = accountSelectorObject.getText().toString();
|
|
|
|
+ String jsonCredData = credReader.getString("data", "");
|
|
|
|
+ Type credentialsType = new TypeToken<ArrayList<MailServerCredentials>>(){}.getType();
|
|
|
|
+ ArrayList<MailServerCredentials> currentUsersCredentials = gson.fromJson(jsonCredData, credentialsType);
|
|
|
|
+
|
|
|
|
+ try {
|
|
|
|
+ for (int i = 0; i < currentUsersCredentials.size(); i++) {
|
|
|
|
+ if (currentUsersCredentials.get(i).getUsername().equals(userInput)) {
|
|
|
|
+ credEditor.putString("currentUser", userInput).apply();
|
|
|
|
+ showCurrentUserObject.setText(String.format("current user:\n%s", userInput));
|
|
|
|
+ showToast("switched account");
|
|
|
|
+ updateNavHeaderText(headerView);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } catch (NullPointerException ignored) {}
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
|
|
|
|
+ deleteAccountObject.setOnClickListener(new View.OnClickListener() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onClick(View view) {
|
|
|
|
+ String userInput = accountSelectorObject.getText().toString();
|
|
|
|
+ String jsonCredData = credReader.getString("data", "");
|
|
|
|
+ Type credentialsType = new TypeToken<ArrayList<MailServerCredentials>>(){}.getType();
|
|
|
|
+ ArrayList<MailServerCredentials> currentUserCredentials = gson.fromJson(jsonCredData, credentialsType);
|
|
|
|
+
|
|
|
|
+ try {
|
|
|
|
+ for (int i = 0; i < currentUserCredentials.size(); i++) {
|
|
|
|
+ if (currentUserCredentials.get(i).getUsername().equals(userInput)) {
|
|
|
|
+ currentUserCredentials.remove(i);
|
|
|
|
+ credEditor.putString("data", gson.toJson(currentUserCredentials, credentialsType)).apply();
|
|
|
|
+ if (!currentUserCredentials.isEmpty()) {
|
|
|
|
+ String usernameZero = currentUserCredentials.get(0).getUsername();
|
|
|
|
+ credEditor.putString("currentUser", usernameZero).apply();
|
|
|
|
+ showCurrentUserObject.setText(String.format("current user:\n%s", usernameZero));
|
|
|
|
+ } else {
|
|
|
|
+ credEditor.putString("currentUser", "").apply();
|
|
|
|
+ showCurrentUserObject.setText("current user:\n None");
|
|
|
|
+ }
|
|
|
|
+ showToast("account removed");
|
|
|
|
+ updateNavHeaderText(headerView);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } catch (NullPointerException ignored) {}
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ changeServerSettingsObject.setOnClickListener(new View.OnClickListener() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onClick(View view) {
|
|
String userInput = accountSelectorObject.getText().toString();
|
|
String userInput = accountSelectorObject.getText().toString();
|
|
String jsonCredData = credReader.getString("data", "");
|
|
String jsonCredData = credReader.getString("data", "");
|
|
Type credentialsType = new TypeToken<ArrayList<MailServerCredentials>>() {
|
|
Type credentialsType = new TypeToken<ArrayList<MailServerCredentials>>() {
|
|
}.getType();
|
|
}.getType();
|
|
- ArrayList<MailServerCredentials> currentUsersCredentials = gson.fromJson(jsonCredData, credentialsType);
|
|
|
|
-
|
|
|
|
- System.out.println(userInput);
|
|
|
|
- for (int i = 0; i < currentUsersCredentials.size(); i++) {
|
|
|
|
- if (currentUsersCredentials.get(i).getUsername().equals(userInput)) {
|
|
|
|
- credEditor.putString("currentUser", userInput);
|
|
|
|
- showCurrentUserObject.setText(String.format("current user:\n%s", userInput));
|
|
|
|
- showToast("switched account");
|
|
|
|
- break;
|
|
|
|
|
|
+ ArrayList<MailServerCredentials> currentUserCredentials = gson.fromJson(jsonCredData, credentialsType);
|
|
|
|
+
|
|
|
|
+ String email, name, password, smtpHost, imapHost = null;
|
|
|
|
+ int smtpPort, imapPort = 0;
|
|
|
|
+ try {
|
|
|
|
+ for (int i = 0; i < currentUserCredentials.size(); i++) {
|
|
|
|
+ if (currentUserCredentials.get(i).getUsername().equals(userInput)) {
|
|
|
|
+ email = currentUserCredentials.get(i).getUsername();
|
|
|
|
+ name = currentUserCredentials.get(i).getName();
|
|
|
|
+ password = currentUserCredentials.get(i).getPassword();
|
|
|
|
+ smtpHost = currentUserCredentials.get(i).getSmtpHost();
|
|
|
|
+ imapHost = currentUserCredentials.get(i).getImapHost();
|
|
|
|
+ smtpPort = currentUserCredentials.get(i).getSmtpPort();
|
|
|
|
+ imapPort = currentUserCredentials.get(i).getImapPort();
|
|
|
|
+ changeMailServerSettingsDialog(name, email, password, headerView, imapHost, smtpHost, imapPort,
|
|
|
|
+ smtpPort, false);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ } catch (NullPointerException ignored) {}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
- exit.setOnClickListener(v -> dialog.dismiss());
|
|
|
|
|
|
+ exit.setOnClickListener(v -> rootAccountManagerDialog.dismiss());
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- /* invoke toolbar */
|
|
|
|
- Toolbar toolbar = findViewById(R.id.toolbar);
|
|
|
|
- setSupportActionBar(toolbar);
|
|
|
|
|
|
|
|
- /* invoke drawer */
|
|
|
|
- DrawerLayout drawer = findViewById(drawer_layout);
|
|
|
|
- NavigationView navigationView = findViewById(R.id.nav_view);
|
|
|
|
- View headerView = navigationView.getHeaderView(0);
|
|
|
|
- /*
|
|
|
|
- Passing each menu ID as a set of Ids because each
|
|
|
|
- menu should be considered as top level destinations.
|
|
|
|
- */
|
|
|
|
- mAppBarConfiguration = new AppBarConfiguration.Builder(
|
|
|
|
- R.id.nav_home, R.id.nav_gallery, R.id.nav_slideshow, R.id.nav_archive, R.id.nav_spam)
|
|
|
|
- .setDrawerLayout(drawer)
|
|
|
|
- .build();
|
|
|
|
- NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
|
|
|
|
- NavigationUI.setupActionBarWithNavController(this, navController, mAppBarConfiguration);
|
|
|
|
- NavigationUI.setupWithNavController(navigationView, navController);
|
|
|
|
|
|
|
|
/* Lookup the recyclerview in activity layout */
|
|
/* Lookup the recyclerview in activity layout */
|
|
recyclerView = findViewById(R.id.recyclerView);
|
|
recyclerView = findViewById(R.id.recyclerView);
|
|
@@ -253,10 +319,8 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
|
|
message_create_button.setOnClickListener(new View.OnClickListener() {
|
|
message_create_button.setOnClickListener(new View.OnClickListener() {
|
|
@Override
|
|
@Override
|
|
public void onClick(View v) {
|
|
public void onClick(View v) {
|
|
-
|
|
|
|
DialogFragment dialog = MessageCreateFragment.newInstance();
|
|
DialogFragment dialog = MessageCreateFragment.newInstance();
|
|
dialog.show(getSupportFragmentManager(), "tag");
|
|
dialog.show(getSupportFragmentManager(), "tag");
|
|
-
|
|
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
@@ -312,6 +376,9 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ } else {
|
|
|
|
+ navHeaderEmailObject.setText(R.string.noAccountsAddedNavHeaderMessageEmail);
|
|
|
|
+ navHeaderNameObject.setText(R.string.noAccountsAddedNavHeaderMessageName);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -333,9 +400,10 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
|
|
|
|
|
|
|
|
|
|
/* better leave empty to avoid any listener disambiguity */
|
|
/* better leave empty to avoid any listener disambiguity */
|
|
- public void onClick(View view) { }
|
|
|
|
|
|
+ public void onClick(View view) {}
|
|
|
|
|
|
- public void changeMailServerSettingsDialog(String name, String email, String password, View headerView) {
|
|
|
|
|
|
+ public void changeMailServerSettingsDialog(String name, String email, String password, View headerView, String imapHost,
|
|
|
|
+ String smtpHost, int imapPort, int smtpPort, boolean wantToAddNew) {
|
|
/* define View window */
|
|
/* define View window */
|
|
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this);
|
|
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this);
|
|
final View changeMailServerSettingsView = getLayoutInflater().inflate(R.layout.mail_credentials_customizer, null);
|
|
final View changeMailServerSettingsView = getLayoutInflater().inflate(R.layout.mail_credentials_customizer, null);
|
|
@@ -351,15 +419,13 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
|
|
Button cancelButton = (Button) changeMailServerSettingsView.findViewById(R.id.cancelCustomizeButton);
|
|
Button cancelButton = (Button) changeMailServerSettingsView.findViewById(R.id.cancelCustomizeButton);
|
|
|
|
|
|
/* set assumed input in corresponding fields */
|
|
/* set assumed input in corresponding fields */
|
|
- incomingServerObject.setText(MailFunctions.getImapHostFromEmail(email));
|
|
|
|
- outgoingServerObject.setText(MailFunctions.getSmtpHostFromEmail(email));
|
|
|
|
- incomingPortObject.setText("993");
|
|
|
|
- outgoingPortObject.setText("587");
|
|
|
|
|
|
+ incomingServerObject.setText(imapHost);
|
|
|
|
+ outgoingServerObject.setText(smtpHost);
|
|
|
|
+ incomingPortObject.setText(String.valueOf(imapPort));
|
|
|
|
+ outgoingPortObject.setText(String.valueOf(smtpPort));
|
|
serverUsernameObject.setText(email);
|
|
serverUsernameObject.setText(email);
|
|
passwordObject.setText(password);
|
|
passwordObject.setText(password);
|
|
|
|
|
|
- /* TODO: add save and cancel button functionality */
|
|
|
|
-
|
|
|
|
/* open View window */
|
|
/* open View window */
|
|
dialogBuilder.setView(changeMailServerSettingsView);
|
|
dialogBuilder.setView(changeMailServerSettingsView);
|
|
dialog = dialogBuilder.create();
|
|
dialog = dialogBuilder.create();
|
|
@@ -368,10 +434,17 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
|
|
saveButton.setOnClickListener(new View.OnClickListener() {
|
|
saveButton.setOnClickListener(new View.OnClickListener() {
|
|
@Override
|
|
@Override
|
|
public void onClick(View view) {
|
|
public void onClick(View view) {
|
|
- addNewAccountCredentials(name, serverUsernameObject.getText().toString(), passwordObject.getText().toString(),
|
|
|
|
- Integer.parseInt(incomingPortObject.getText().toString()), Integer.parseInt(outgoingPortObject.getText().toString()),
|
|
|
|
- incomingServerObject.getText().toString(), outgoingServerObject.getText().toString(), dialog, false,
|
|
|
|
- headerView);
|
|
|
|
|
|
+ if (wantToAddNew) {
|
|
|
|
+ addNewAccountCredentials(name, serverUsernameObject.getText().toString(), passwordObject.getText().toString(),
|
|
|
|
+ Integer.parseInt(incomingPortObject.getText().toString()), Integer.parseInt(outgoingPortObject.getText().toString()),
|
|
|
|
+ incomingServerObject.getText().toString(), outgoingServerObject.getText().toString(), dialog, false,
|
|
|
|
+ headerView);
|
|
|
|
+ } else {
|
|
|
|
+ changeAccountCredentials(name, serverUsernameObject.getText().toString(),
|
|
|
|
+ passwordObject.getText().toString(), Integer.parseInt(incomingPortObject.getText().toString()),
|
|
|
|
+ Integer.parseInt(outgoingPortObject.getText().toString()), incomingServerObject.getText().toString(),
|
|
|
|
+ outgoingServerObject.getText().toString(), dialog, headerView, email);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
@@ -389,7 +462,9 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
|
|
.setPositiveButton("Yes",new DialogInterface.OnClickListener() {
|
|
.setPositiveButton("Yes",new DialogInterface.OnClickListener() {
|
|
public void onClick(DialogInterface dialog, int id) {
|
|
public void onClick(DialogInterface dialog, int id) {
|
|
/*if this button is clicked, close the whole fragment */
|
|
/*if this button is clicked, close the whole fragment */
|
|
- changeMailServerSettingsDialog(name, email, password, headerView);
|
|
|
|
|
|
+ changeMailServerSettingsDialog(name, email, password, headerView,
|
|
|
|
+ MailFunctions.getImapHostFromEmail(email), MailFunctions.getSmtpHostFromEmail(email), 993, 587,
|
|
|
|
+ true);
|
|
}
|
|
}
|
|
})
|
|
})
|
|
.setNegativeButton("No",new DialogInterface.OnClickListener() {
|
|
.setNegativeButton("No",new DialogInterface.OnClickListener() {
|
|
@@ -412,7 +487,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
|
|
|
|
|
|
/* connect to mail server */
|
|
/* connect to mail server */
|
|
showToast("Probe Connection ...");
|
|
showToast("Probe Connection ...");
|
|
- if (MailFunctions.canConnect(MailFunctions.getImapHostFromEmail(email), email, password) == Boolean.TRUE) {
|
|
|
|
|
|
+ if (MailFunctions.canConnect(imapHost, email, password) == Boolean.TRUE) {
|
|
showToast("was able to connect");
|
|
showToast("was able to connect");
|
|
|
|
|
|
Gson gson = new Gson();
|
|
Gson gson = new Gson();
|
|
@@ -459,6 +534,42 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /* use 'initialMail' variable so that the program knows which email entry is has to change */
|
|
|
|
+ public void changeAccountCredentials(String name, String email, String password, int imapPort,
|
|
|
|
+ int smtpPort, String imapHost, String smtpHost, DialogInterface dialogContext,
|
|
|
|
+ View headerView, String initialEmail) {
|
|
|
|
+ credentialsEditor = mailServerCredentials.edit();
|
|
|
|
+
|
|
|
|
+ /* connect to mail server */
|
|
|
|
+ showToast("Probe Connection ...");
|
|
|
|
+ if (MailFunctions.canConnect(imapHost, email, password) == Boolean.TRUE) {
|
|
|
|
+ showToast("was able to connect");
|
|
|
|
+
|
|
|
|
+ Gson gson = new Gson();
|
|
|
|
+
|
|
|
|
+ /* read login credentials from SharedPreferences */
|
|
|
|
+ SharedPreferences initialCredentialsReader = getSharedPreferences(
|
|
|
|
+ "Credentials", Context.MODE_PRIVATE);
|
|
|
|
+ String initialReadJsonData = initialCredentialsReader.getString("data", "");
|
|
|
|
+ Type credentialsType = new TypeToken<ArrayList<MailServerCredentials>>(){}.getType();
|
|
|
|
+ ArrayList<MailServerCredentials> allUsersCredentials = gson.fromJson(initialReadJsonData, credentialsType);
|
|
|
|
+
|
|
|
|
+ for (int i = 0; i < allUsersCredentials.size(); i++) {
|
|
|
|
+ if (allUsersCredentials.get(i).getUsername().equals(initialEmail)) {
|
|
|
|
+ String signature = allUsersCredentials.get(i).getSignature();
|
|
|
|
+ allUsersCredentials.set(i, new MailServerCredentials(name, email, password, imapHost, smtpHost, imapPort,
|
|
|
|
+ smtpPort, signature));
|
|
|
|
+ credentialsEditor.putString("data", gson.toJson(allUsersCredentials, credentialsType)).apply();
|
|
|
|
+ showToast("changed account credentials");
|
|
|
|
+ dialogContext.dismiss();
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ showToast("Error: failed to get connection");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
public void createNewEmailDialog(View headerView){
|
|
public void createNewEmailDialog(View headerView){
|
|
/* define View window */
|
|
/* define View window */
|
|
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this);
|
|
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this);
|