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; /*w ww . j a v a 2s . c om*/ 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 DBUpdateAction extends BaseAction { private DBListActivity activity; private Long friend_id; public DBUpdateAction(DBListActivity activity, Long friend_id) { this.activity = activity; this.friend_id = friend_id; } // BL?? @Override public ActionResult exec() { // DB????? Friend f = new FriendDAO(activity).invertFavoriteFlag(friend_id); // ?????????? DBUpdateActionResult ares = new DBUpdateActionResult(); ares.setRouteId("success"); ares.friend = f; return ares; } // NOTE: setRouteId???Base???????????????????????????????????????????????????????????????????? // ??????????? static class DBUpdateActionResult extends ActionResult { private static final long serialVersionUID = 1L; protected Friend friend; @Override public void onNextActivityStarted(Activity activity) { UIUtil.longToast(activity, friend.getName() + "???????????????????????????????????"); } } }