Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-client-android
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-client-android
Commits
645b29c2
Commit
645b29c2
authored
12 years ago
by
Alexandre Savard
Browse files
Options
Downloads
Patches
Plain Diff
#17105 Add dialog to prevent wrong account deletion
parent
5195d92c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/com/savoirfairelinux/sflphone/client/AccountPreferenceActivity.java
+38
-0
38 additions, 0 deletions
...fairelinux/sflphone/client/AccountPreferenceActivity.java
with
38 additions
and
0 deletions
src/com/savoirfairelinux/sflphone/client/AccountPreferenceActivity.java
+
38
−
0
View file @
645b29c2
...
...
@@ -32,8 +32,11 @@
package
com.savoirfairelinux.sflphone.client
;
import
android.app.Activity
;
import
android.app.AlertDialog
;
import
android.app.Dialog
;
import
android.content.ComponentName
;
import
android.content.Context
;
import
android.content.DialogInterface
;
import
android.content.ServiceConnection
;
import
android.content.Intent
;
import
android.os.Bundle
;
...
...
@@ -196,6 +199,10 @@ public class AccountPreferenceActivity extends PreferenceActivity
@Override
public
boolean
onOptionsItemSelected
(
MenuItem
item
)
{
AlertDialog
dialog
=
createAlertDialog
();
dialog
.
show
();
/*
Bundle bundle = new Bundle();
bundle.putString("AccountID", mAccountID);
...
...
@@ -204,9 +211,40 @@ public class AccountPreferenceActivity extends PreferenceActivity
setResult(ACCOUNT_DELETED, resultIntent);
finish();
*/
return
true
;
}
private
AlertDialog
createAlertDialog
()
{
Activity
ownerActivity
=
this
;
AlertDialog
.
Builder
builder
=
new
AlertDialog
.
Builder
(
ownerActivity
);
builder
.
setMessage
(
"Do you realy want to delete this account"
).
setTitle
(
"Delete Account"
)
.
setPositiveButton
(
"Ok"
,
new
DialogInterface
.
OnClickListener
()
{
public
void
onClick
(
DialogInterface
dialog
,
int
whichButton
)
{
Bundle
bundle
=
new
Bundle
();
bundle
.
putString
(
"AccountID"
,
mAccountID
);
Intent
resultIntent
=
new
Intent
();
resultIntent
.
putExtras
(
bundle
);
Activity
activity
=
((
Dialog
)
dialog
).
getOwnerActivity
();
activity
.
setResult
(
ACCOUNT_DELETED
,
resultIntent
);
activity
.
finish
();
}
})
.
setNegativeButton
(
"Cancel"
,
new
DialogInterface
.
OnClickListener
()
{
public
void
onClick
(
DialogInterface
dialog
,
int
whichButton
)
{
/* Terminate with no action */
}
});
AlertDialog
alertDialog
=
builder
.
create
();
alertDialog
.
setOwnerActivity
(
ownerActivity
);
return
alertDialog
;
}
private
void
updateAccountDetails
(
HashMap
<
String
,
String
>
accountDetails
,
AccountDetail
det
)
{
for
(
AccountDetail
.
PreferenceEntry
p
:
det
.
getDetailValues
())
{
Preference
pref
=
mPreferenceManager
.
findPreference
(
p
.
mKey
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment