Comments (2)
I will give it a try...I'm going to update soon.
from upm-android.
I believe I found the relevant code aside from the account_context_menu.xml to add the option on screen, and I believe AccountsList.java where we should execute the code under the"case R.id.edit_account:" code.
In ViewAccountDetails.jave is where I found reference to actually deleting an account.
case R.id.delete:
if (Utilities.isSyncRequired(this)) {
UIUtilities.showToast(this, R.string.sync_required);
} else {
showDialog(CONFIRM_DELETE_DIALOG);
}
break;
}
return optionConsumed;
}
@Override
protected Dialog onCreateDialog(int id) {
Dialog dialog = null;
switch(id) {
case CONFIRM_DELETE_DIALOG:
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage("Are you sure?")
.setTitle("Confirm Delete")
.setCancelable(false)
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
getPasswordDatabase().deleteAccount(account.getAccountName());
final String accountName = account.getAccountName();
new SaveDatabaseAsyncTask(ViewAccountDetails.this, new Callback() {
@Override
public void execute() {
String message = String.format(getString(R.string.account_deleted), accountName);
Toast.makeText(ViewAccountDetails.this, message, Toast.LENGTH_SHORT).show();
//Â Set this flag so that when we're returned to the FullAccountList
// activity the list is refreshed
ViewAccountDetails.this.setResult(AddEditAccount.EDIT_ACCOUNT_RESULT_CODE_TRUE);
finish();
}
}).execute(getPasswordDatabase());
}
})
.setNegativeButton("No", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
dialog = builder.create();
}
return dialog;
}
But since this is calling it from the account its already in, I'm not sure how to make it call the same account from AccountsList.
from upm-android.
Related Issues (20)
- NullPointerException when returning to app HOT 1
- Backup path for database HOT 2
- How to get the UPM database from Linux to Android (Milestone 2) HOT 1
- Feature Request: Tablet Version HOT 4
- UPM is incorrectly using HTTP post to download the DB file HOT 1
- Should sync on start
- Invalid password message
- UPM closes after password input on Lollipop android 5.1
- forgets license file
- Google drive sync
- Sync with Dropbox doesn't work anymore (possibly due to depreciated api version) HOT 2
- enhancement: add folder structure
- NOT available on play store HOT 9
- Sync with Dropbox stopped working HOT 3
- UPM - Backup HOT 1
- Unable to sync via WebDav (even ver 1.20) HOT 1
- UPM "Problem performing file operation" HOT 1
- http access / sync with version 1.2 doesn't work any more
- Can't seem to Sync.. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from upm-android.