@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { rootView = inflater.inflate(R.layout.proanswerwrite, container, false); dbVersion = ((MainActivity) getActivity()).getDBVersion(); mTwoPane = ((MainActivity) getActivity()).getTwoPane(); num = getArguments().getString("num"); ansCount = getArguments().getString("ansCount"); dbHelper = new DBHelper(getActivity(), dbName, null, dbVersion); db = dbHelper.getWritableDatabase(); sql = "SELECT * FROM inner_db;"; Cursor cursor = db.rawQuery(sql, null); cursor.moveToFirst(); tempnick = cursor.getString(3); abar = ((MainActivity) getActivity()).getSupportActionBar(); abar.setTitle(tempnick + "님에게 답변중"); abar.setDisplayOptions(ActionBar.DISPLAY_SHOW_TITLE); abar.setDisplayHomeAsUpEnabled(true); ldialog = new LoadingDialog(this.getActivity()); // 변경 ldialog .getWindow() .setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT)); ldialog.show(); answerViewThread = (AnswerViewThread) new AnswerViewThread(); answerViewThread.execute(); conet = (EditText) rootView.findViewById(R.id.replycon); conet.setPadding(20, 20, 20, 20); return rootView; }
public void checkInput() { conet = (EditText) rootView.findViewById(R.id.replycon); writecon = conet.getText().toString(); writecon = writecon.trim(); if (writecon.getBytes().length <= 0) { conet.requestFocus(); InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE); Toast.makeText(getActivity(), "내용을 채워주세요", Toast.LENGTH_SHORT).show(); } else { ldialog = new LoadingDialog(this.getActivity()); // 변경 ldialog .getWindow() .setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT)); ldialog.show(); answerWriteThread = (AnswerWriteThread) new AnswerWriteThread(); answerWriteThread.execute(); } }