안녕하세요. 시원한물냉입니다^^ Date선택하는 Dialog에대해 살펴보겠습니다. public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); DatePickerDialog dateDialog = new DatePickerDialog(this, listener, 2015, 01, 16); dateDialog.show(); } private OnDateSetListener listener = new OnDateSetListener() { @O..
XML 소스에서 다음을 추가해주면 된다. android:inputType="" 속성은 number 양수 numberSigned 양수,음수 numberDecimal 양수 소수점 java 소스상에서는.setInputType(type) 속성은 android:inputTypeThe type of data being placed in a text field, used to help an input method decide how to let the user enter text. The constants here correspond to those defined by InputType. Generally you can select a single value, though some can be combined tog..
안드로이드에서 파일로 저장하는 건 자바와 조금 다릅니다디비와 다르게 내가 원하는 형태로 쉽게 저장이 되기 때문에저는 종종 사용합니다 왜 sqlite를 안쓰고 이렇게 쓰냐구요?그건 이렇게 저장하면 어플을 지워도 파일은 그대로 남아 있어요 ㅋㅋ저장하는 위치를 잡아주면 어플을 지우면 같이 날아가는데이건 핸드폰 초기화전에는 남아 있죠 나름 쓸데가 있답니다 ㅎㅎ 저장하기try { FileOutputStream fos = this.openFileOutput("파일이름", Context.MODE_PRIVATE); ObjectOutputStream oos = new ObjectOutputStream(fos); oos.writeObject(저장할데이터); oos.close(); } catch (Exception e) {..
import java.util.Scanner; public class Sosusum { public static void main(String[] args) { System.out.println("입력돈 숫자까지의 소수 구하기"); System.out.print("입력 : "); int inNum = 0; Scanner scan = new Scanner(System.in); inNum = scan.nextInt(); // ------------------------------ // 입력된 숫자까지의 소수 구하기 // ------------------------------ for (int i = 2; i