Page 92 - 3-3
P. 92
public class Network extends Activity implements OnClickListener {
private TextView iph;
private boolean FinishFlag;
private int flag =0;
private int l;
private Button light;
MyThread th = null;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
setContentView(R.layout.network);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
iph = (TextView) findViewById(R.id.ipHere);
light = (Button) findViewById (R.id.lightBtn);
Button setBtn = (Button) findViewByld(R.id.setBtn);
Button resetBtn = (Button) findViewByld(R.id.resetBtn);
Button homeBtn = (Button) findViewByld(R.id.homeBtn);
setBtn.setOnClickListener(this);
resetBtn.setOnClickListener(this);
homeBtn.setOnClickListener(this);
light.setOnClickListener(this);
getPreferences();
}
// 값 불러오기
private void getPreferences(){
SharedPreferences pref = getSharedPreferences("pref", MODE_PRIVATE);
iph.setText("IP: " + pref.getString
- 92 -