Back to project page notes.
The source code is released under:
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004 Copyright (C) 2004 Sam Hocevar <sam@hocevar.net> Everyone is permitted to copy and distribute verbatim or...
If you think the Android project notes listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.iliakplv.notes.gui.main.dialogs; //w w w. jav a2s . co m import android.app.Activity; import android.app.DialogFragment; import android.os.Bundle; import com.iliakplv.notes.notes.storage.NotesStorage; import com.iliakplv.notes.notes.storage.Storage; import java.io.Serializable; public abstract class AbstractItemDialog extends DialogFragment { public static final String EXTRA_ID = "item_id"; protected NotesStorage storage = Storage.getStorage(); protected Activity activity; protected Serializable id; @Override public void onAttach(Activity activity) { super.onAttach(activity); this.activity = getActivity(); } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); final Bundle args = getArguments(); if (args == null || !args.containsKey(EXTRA_ID)) { throw new RuntimeException("Item id required"); } id = args.getSerializable(EXTRA_ID); } protected static Bundle createArgumentsBundle(Serializable id) { final Bundle args = new Bundle(); args.putSerializable(EXTRA_ID, id); return args; } }