worning.java
1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
package com.lotus.town.notify;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.lotus.town.R;
import com.lotus.town.utils.NotificationUtils;
/**
* 内存警告
*/
public abstract class worning extends Activity implements View.OnClickListener {
protected ImageView mWorningImage = null;
protected TextView mWoringText = null;
protected TextView mSelfWork = null;
protected TextView mAutoWork = null;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
NotificationUtils.clearNotification(this);
setContentView(R.layout.worning_notify_layout);
setFinishOnTouchOutside(false);
initView();
initInfo();
}
private void initView() {
mWorningImage = findViewById(R.id.worning_icon);
mWoringText = findViewById(R.id.worning_text);
mSelfWork = findViewById(R.id.self_work);
mAutoWork = findViewById(R.id.auto_work);
mSelfWork.setOnClickListener(this);
mAutoWork.setOnClickListener(this);
}
protected abstract void initInfo();
@Override
public void onBackPressed() {
gotoWork();
}
@Override
public void onClick(View v) {
gotoWork();
}
private void gotoWork(){
Intent i = new Intent();
i.setClass(this,getDestActivity());
if(!TextUtils.isEmpty(deliver())){
i.putExtra("deliver",deliver());
}
startActivity(i);
finish();
}
public abstract Class getDestActivity();
public String deliver(){
return "";
};
}