안드로이드 앱개발 중 문제가 생겼습니다.. 런타임오류인데요..타임피커 문제입니다..

mmx822의 이미지

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.Toast;
 
public class Cleaninfo extends Activity {
 private ArrayList<Custom_List_Data_clean> Array_Data = new ArrayList<Custom_List_Data_clean>();
 private Custom_List_Data_clean data;
 private Custom_List_Adapter_clean adapter;
 ListView listview;
 DatePicker mDate;
 String date;
 
 /** Called when the activity is first created. */
 @Override
 public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.cleaninfo);
  // DatePicker
 
  // TODO Auto-generated method stub
 }
 
 public void onClickButton(View v) {
  Log.i("Cleaninfo", "onClickButton");
  int id = v.getId();
  Intent intent1;
  switch (id) {
  case R.id.button1:
 
   final LinearLayout linear = (LinearLayout) View.inflate(this,
     R.layout.dial_cleaninfo, null);
   mDate = (DatePicker) findViewById(R.id.datePicker1);
   mDate.init(mDate.getYear(), mDate.getMonth(),
     mDate.getDayOfMonth(),
     new DatePicker.OnDateChangedListener() {
      public void onDateChanged(DatePicker view, int year,
        int monthOfYear, int dayOfMonth) {
       date = String.format("%d-%d-%d", year,
         monthOfYear + 1, dayOfMonth);
      }
     });
   new AlertDialog.Builder(this)
     .setTitle("청소 정보를 입력하시오.")
     .setIcon(R.drawable.icon)
     .setView(linear)
     .setPositiveButton("확인",
       new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog,
          int whichButton) {
         EditText content = (EditText) linear
           .findViewById(R.id.clean_content);
         data = new Custom_List_Data_clean(
           R.drawable.icon_lv, date, content
             .getText().toString());
         Array_Data.add(data);
         custom_adapter();
         adapter.notifyDataSetChanged();
        }
       })
     .setNegativeButton("취소",
       new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog,
          int whichButton) {
        }
       }).show();
 
   break;
  case R.id.button2:
   Toast.makeText(this, "삭제하려는 청소정보를 2초간 터치해주세요!", Toast.LENGTH_SHORT)
     .show();
   break;
  }
 }
 
 public void custom_adapter() {
  listview = (ListView) findViewById(R.id.listView1);
  adapter = new Custom_List_Adapter_clean(this,
    android.R.layout.simple_list_item_1, Array_Data);
  listview.setAdapter(adapter);
 }
}

위의 코드에서 logcat을 통해 알아본 결과 mDate.init(mDate.getYear(), mDate.getMonth(), 이 타임피커 부분이 문제라고합니다;;

문법상으론 문제가 없어보이는데 이상하게 런타임 오류가 나네요..

문제 해결이 시급합니다..꼭 좀 도와주세요 ㅜㅜ

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.