Skip to content

Commit

Permalink
la svolta
Browse files Browse the repository at this point in the history
Signed-off-by: simonewebdesign <hello@simonewebdesign.it>
  • Loading branch information
simonewebdesign committed Mar 7, 2013
1 parent 00ef1c1 commit e673aec
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/com/example/todolist/ItemView.java
Expand Up @@ -65,7 +65,7 @@ public boolean onLongClick(View v) {

// do something when the ItemView is longClicked
Log.v(TAG, "ItemView has been longClicked!");
ItemViewDialogFragment dialog = new ItemViewDialogFragment();
ItemViewDialogFragment dialog = new ItemViewDialogFragment((ItemView) v);
dialog.show(((MainActivity) context).getSupportFragmentManager(), "dialog");

return false;
Expand Down
17 changes: 17 additions & 0 deletions src/com/example/todolist/ItemViewDialogFragment.java
Expand Up @@ -13,7 +13,24 @@ public class ItemViewDialogFragment extends DialogFragment {
private final String TAG = "ItemViewDialogFragment";
// Use this instance of the interface to deliver action events
private ItemViewDialogListener mListener;
private ItemView itemView;

public ItemView getItemView() {
return itemView;
}

public void setItemView(ItemView itemView) {
this.itemView = itemView;
}

public ItemViewDialogFragment() {
super();
}

public ItemViewDialogFragment(ItemView v) {
super();
itemView = v;
}

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
Expand Down
3 changes: 3 additions & 0 deletions src/com/example/todolist/MainActivity.java
Expand Up @@ -236,5 +236,8 @@ public void onDialogEditClick(DialogFragment dialog) {
public void onDialogDeleteClick(DialogFragment dialog) {
// TODO Auto-generated method stub
Log.v(TAG, "onDialogDeleteClick");

ItemView view = ((ItemViewDialogFragment) dialog).getItemView();

}
}

0 comments on commit e673aec

Please sign in to comment.