Page 201 - MDP2022-2
P. 201
}
});
new Handler().postDelayed(() -> {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setTitle("오류").setMessage("WiFi가 비활성화 되었습니다.");
builder.setPositiveButton("재시도", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
Toast.makeText(getActivity(), "재시도", Toast.LENGTH_SHORT).show();
}
});
AlertDialog alertDialog = builder.create();
alertDialog.show();
}, 10000);
return view;
}
}
package com.headthings.mdp_project_2022;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.CompoundButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.Switch;
import android.widget.TextView;
public class OneClickView extends LinearLayout implements CompoundButton.OnCheckedChangeL
istener {
private LinearLayout bg;
private ImageView symbol;
private TextView text;
private Switch power;