-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathactivity_appLock.java
More file actions
38 lines (29 loc) · 986 Bytes
/
activity_appLock.java
File metadata and controls
38 lines (29 loc) · 986 Bytes
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
package com.example.tx1;
import com.example.tx1.service.WatchDogService;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
public class activity_appLock extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_app_lock);
Button bt_start_lock = (Button) findViewById(R.id.bt_start_lock);
Button bt_end_lock = (Button) findViewById(R.id.bt_end_lock);
bt_start_lock.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
startService(new Intent(getApplicationContext(), WatchDogService.class));
}
});
bt_end_lock.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
stopService(new Intent(getApplicationContext(), WatchDogService.class));
}
});
}
}