|
18 | 18 | import android.app.Activity;
|
19 | 19 | import android.content.Intent;
|
20 | 20 | import android.os.Bundle;
|
21 |
| -import android.util.Log; |
22 | 21 | import android.view.View;
|
23 | 22 |
|
24 |
| -import com.shizhefei.mvc.RequestHandle; |
25 |
| -import com.shizhefei.mvc.ResponseSender; |
26 |
| -import com.shizhefei.task.Code; |
27 |
| -import com.shizhefei.task.IAsyncTask; |
28 |
| -import com.shizhefei.task.ICallback; |
29 |
| -import com.shizhefei.task.TaskHandle; |
30 |
| -import com.shizhefei.task.TaskHelper; |
31 |
| -import com.shizhefei.task.function.Func1; |
32 |
| -import com.shizhefei.task.imp.MemoryCacheStore; |
33 |
| -import com.shizhefei.task.tasks.LinkTask; |
34 |
| -import com.shizhefei.task.tasks.Tasks; |
35 | 23 | import com.shizhefei.test.controllers.mvchelpers.CoolActivity;
|
36 | 24 | import com.shizhefei.test.controllers.mvchelpers.NormalActivity;
|
37 | 25 | import com.shizhefei.test.controllers.mvchelpers.PullrefshActivity;
|
38 | 26 | import com.shizhefei.test.controllers.mvchelpers.SwipeRefreshActivity;
|
39 | 27 | import com.shizhefei.test.controllers.mvchelpers.UltraActivity;
|
40 | 28 | import com.shizhefei.test.controllers.other.BookDetailActivity;
|
41 |
| -import com.shizhefei.test.controllers.other.MovieDetailActivity; |
42 | 29 | import com.shizhefei.test.controllers.other.MultiTypeActivity;
|
43 | 30 | import com.shizhefei.test.controllers.other.UltraRecyclerViewActivity;
|
44 | 31 | import com.shizhefei.test.controllers.other.Volley_OKHttp_GridViewActivity;
|
45 | 32 | import com.shizhefei.test.controllers.task.ListTaskActivity;
|
46 |
| -import com.shizhefei.test.controllers.task.LoginActivity; |
47 |
| -import com.shizhefei.test.controllers.task.TaskDemoActivity; |
48 |
| -import com.shizhefei.test.controllers.task.TaskOpActivity; |
49 |
| -import com.shizhefei.test.controllers.task.TestNormalTaskActivity; |
50 |
| -import com.shizhefei.test.models.task.LoginTask; |
51 | 33 | import com.shizhefei.view.mvc.demo.R;
|
52 | 34 |
|
53 | 35 | public class MainActivity extends Activity {
|
54 | 36 |
|
55 |
| - private TaskHelper<Object> taskHelper; |
56 |
| - private LoginTask loginTask; |
57 |
| - private TaskHandle taskHandle; |
58 |
| - |
59 | 37 | @Override
|
60 | 38 | protected void onCreate(Bundle savedInstanceState) {
|
61 | 39 | super.onCreate(savedInstanceState);
|
62 | 40 | setContentView(R.layout.activity_main);
|
63 |
| - |
64 |
| - taskHelper = new TaskHelper<>(new MemoryCacheStore(100)); |
65 |
| - |
66 |
| - taskHelper.registerCallBack(new ICallback<Object>() { |
67 |
| - @Override |
68 |
| - public void onPreExecute(Object task) { |
69 |
| - Log.d("vvvv", "registCallBak onPreExecute task:" + task); |
70 |
| - } |
71 |
| - |
72 |
| - @Override |
73 |
| - public void onProgress(Object task, int percent, long current, long total, Object extraData) { |
74 |
| -// Log.d("vvvv", "registCallBak onProgress current:"+current+" task:" + task); |
75 |
| - } |
76 |
| - |
77 |
| - @Override |
78 |
| - public void onPostExecute(Object task, Code code, Exception exception, Object Object) { |
79 |
| - Log.d("vvvv", "registCallBak onPostExecute task:" + task + " code:" + code); |
80 |
| - } |
81 |
| - }); |
82 |
| - } |
83 |
| - |
84 |
| - @Override |
85 |
| - protected void onDestroy() { |
86 |
| - super.onDestroy(); |
87 |
| - taskHelper.destroy(); |
88 | 41 | }
|
89 | 42 |
|
90 | 43 | /**
|
@@ -159,15 +112,6 @@ public void onClickDemo6(View view) {
|
159 | 112 | startActivity(new Intent(getApplicationContext(), UltraRecyclerViewActivity.class));
|
160 | 113 | }
|
161 | 114 |
|
162 |
| - /** |
163 |
| - * 超复杂的界面 |
164 |
| - * |
165 |
| - * @param view |
166 |
| - */ |
167 |
| - public void onClickDemo7(View view) { |
168 |
| - startActivity(new Intent(getApplicationContext(), MovieDetailActivity.class)); |
169 |
| - } |
170 |
| - |
171 | 115 | /**
|
172 | 116 | * Volley和OKhttp网络请求\nandroid-async-http网络请求\n
|
173 | 117 | * GridView界面
|
@@ -195,43 +139,4 @@ public void onClickDemo9(View view) {
|
195 | 139 | public void onClickTask3(View view) {
|
196 | 140 | startActivity(new Intent(getApplicationContext(), ListTaskActivity.class));
|
197 | 141 | }
|
198 |
| - |
199 |
| - /** |
200 |
| - * 登陆Task |
201 |
| - * |
202 |
| - * @param view |
203 |
| - */ |
204 |
| - public void onClickTask1(View view) { |
205 |
| - startActivity(new Intent(getApplicationContext(), LoginActivity.class)); |
206 |
| - } |
207 |
| - |
208 |
| - /** |
209 |
| - * TaskDemo |
210 |
| - * |
211 |
| - * @param view |
212 |
| - */ |
213 |
| - public void onClickTaskDemo(View view) { |
214 |
| - startActivity(new Intent(getApplicationContext(), TaskDemoActivity.class)); |
215 |
| - } |
216 |
| - |
217 |
| - /** |
218 |
| - * 测试task操作符 |
219 |
| - * |
220 |
| - * @param view |
221 |
| - */ |
222 |
| - public void onClickTaskOpDemo(View view) { |
223 |
| - startActivity(new Intent(getApplicationContext(), TaskOpActivity.class)); |
224 |
| - } |
225 |
| - |
226 |
| - |
227 |
| - /** |
228 |
| - * 普通写法测试内存泄漏 |
229 |
| - * |
230 |
| - * @param view |
231 |
| - */ |
232 |
| - public void onClickNormalTaskDemo(View view) { |
233 |
| - startActivity(new Intent(getApplicationContext(), TestNormalTaskActivity.class)); |
234 |
| - } |
235 |
| - |
236 |
| - |
237 | 142 | }
|
0 commit comments