Back to project page android-mvc-framework.
The source code is released under:
Apache License
If you think the Android project android-mvc-framework 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.android_mvc.sample_project.domain; //from ww w . j a va 2 s. c o m import android.app.Activity; import com.android_mvc.sample_project.activities.func_db.DBListActivity; import com.android_mvc.sample_project.db.dao.FriendDAO; import com.android_mvc.sample_project.db.entity.Friend; import com.android_mvc.framework.controller.action.ActionResult; import com.android_mvc.framework.controller.action.BaseAction; import com.android_mvc.framework.ui.UIUtil; /** * DB?????????????????BL? * @author id:language_and_engineering * */ public class DBDeleteAction extends BaseAction { private DBListActivity activity; private Long friend_id; public DBDeleteAction(DBListActivity activity, Long friend_id) { this.activity = activity; this.friend_id = friend_id; } // BL?? @Override public ActionResult exec() { Friend f = new FriendDAO(activity).findById(friend_id); String target_friend_name = f.getName(); // DB???????????? new FriendDAO(activity).deleteById(friend_id); // ?????????? DBDeleteActionResult ares = new DBDeleteActionResult(); ares.setRouteId("success"); ares.friend_name = target_friend_name; // ???????????????????????? return ares; } // ??????????? static class DBDeleteActionResult extends ActionResult { private static final long serialVersionUID = 1L; protected String friend_name; @Override public void onNextActivityStarted(Activity activity) { UIUtil.longToast(activity, friend_name + "????????????????????"); } } }