Back to project page Android-Project-Manager.
The source code is released under:
GNU General Public License
If you think the Android project Android-Project-Manager 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.vaquerosisd.dialog; /*w w w . j a v a 2s .co m*/ import android.app.Activity; import android.app.DialogFragment; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.Window; import android.view.View.OnClickListener; import android.widget.Button; import com.vaquerosisd.projectmanager.ProjectList; import com.vaquerosisd.projectmanager.R; import com.vaquerosisd.projectmanager.TaskList; public class DeleteTaskDialog extends DialogFragment { public static DeleteDialog newInstance() { return new DeleteDialog(); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE); View rootView = inflater.inflate(R.layout.dialog_delete_project, container, false); Button positive = (Button)rootView.findViewById(R.id.positive); Button negative = (Button)rootView.findViewById(R.id.negative); positive.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Activity callerActivity = getActivity(); if(callerActivity instanceof ProjectList) { ((TaskList)callerActivity).deleteTask(); } dismiss(); } }); negative.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { dismiss(); } }); return rootView; } }