/** * Detects and toggles immersive mode (also known as "hidey bar" mode). */ public void toggleHideyBar() { // BEGIN_INCLUDE (get_current_ui_flags) // The UI options currently enabled are represented by a bitfield. // getSystemUiVisibility() gives us that bitfield. int uiOptions = getActivity().getWindow().getDecorView().getSystemUiVisibility(); int newUiOptions = uiOptions; // END_INCLUDE (get..
팝업 윈도우를 타이틀바(액션바)를 포함하여 풀스크린으로 띄우고 싶을 때는 다음과 같은 코드를 이용한다.new를 할때와 showAtLocation할때 동일한 view가 들어가는 것에 유의하자. final View view = getLayoutInflater().inflate(R.layout.rotate_popup, null); private PopupWindow rotatePopup;rotatePopup = new PopupWindow(view, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);rotatePopup.setFocusable(true);rotatePopup.showAtLocation(view, Gravity.C..
public static void hideKeyBoard(View v) { InputMethodManager imm = (InputMethodManager) v.getContext().getSystemService(INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(v.getApplicationWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); } public static void showKeyBoard(View v) { InputMethodManager imm = (InputMethodManager) v.getContext().getSystemService(INPUT_METHOD_SERVICE); imm.showSoftIn..
public static String getDeviceUUID(final Context context) { // preference에서 저장된 것이 있는지 확인해봄 final SharedPreferences prefs = context.getSharedPreferences("UUIDTEST", MODE_PRIVATE); final String id = prefs.getString("UUID", null); UUID uuid = null; if (id != null) { uuid = UUID.fromString(id); } else { final String androidId = Settings.Secure.getString(context.getContentResolver(), Settings.Secure..
// 폰번호를 인식하여 문자를 보내달라고 요청 runOnUiThread(new Runnable() { @Override public void run() { final TelephonyManager tm = (TelephonyManager) getActivity() .getSystemService(Context.TELEPHONY_SERVICE); if(tm == null) return; // 내 폰번호를 받음 String myNumber = tm.getLine1Number(); if(StringUtils.isEmpty(StringUtils.trim(myNumber))) return; // KT일경우 폰번호 변환 if(myNumber.startsWith("+82")) { myNumber = myNumber...
AndroidManifest.xml build.gradle compile 'com.google.code.gson:gson:2.5' compile 'com.github.bumptech.glide:volley-integration:1.3.1' mt_rand.php mt_rand()+1000000000); echo json_encode($ret); ?> public class Uid { private String value; public String getValue() { return value; } } private RequestQueue m..
public boolean hasSoftKeys() { boolean hasSoftwareKeys = true; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { final Display d = getWindowManager().getDefaultDisplay(); final DisplayMetrics realDisplayMetrics = new DisplayMetrics(); d.getRealMetrics(realDisplayMetrics); final int realHeight = realDisplayMetrics.heightPixels; final int realWidth = realDisplayMetrics.widthPixels..
- Total
- Today
- Yesterday