mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-28 21:06:50 +01:00
Amazfit Bip: when deleting activites, delete the correct one
This commit is contained in:
parent
ac98111502
commit
24f98504b0
@ -18,6 +18,8 @@ import nodomain.freeyourgadget.gadgetbridge.util.GB;
|
|||||||
|
|
||||||
public class ActivitySummariesActivity extends AbstractListActivity<BaseActivitySummary> {
|
public class ActivitySummariesActivity extends AbstractListActivity<BaseActivitySummary> {
|
||||||
|
|
||||||
|
private int selectedIndex;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@ -45,8 +47,7 @@ public class ActivitySummariesActivity extends AbstractListActivity<BaseActivity
|
|||||||
delete.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
|
delete.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onMenuItemClick(MenuItem item) {
|
public boolean onMenuItemClick(MenuItem item) {
|
||||||
AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo;
|
deleteItemAt(selectedIndex);
|
||||||
deleteItemAt(info.position);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -56,6 +57,7 @@ public class ActivitySummariesActivity extends AbstractListActivity<BaseActivity
|
|||||||
getItemListView().setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
|
getItemListView().setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
|
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
selectedIndex = position;
|
||||||
return getItemListView().showContextMenu();
|
return getItemListView().showContextMenu();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user