12-10 09:33:08.768: E/AndroidRuntime(594): FATAL EXCEPTION: main
12-10 09:33:08.768: E/AndroidRuntime(594): java.lang.NullPointerException
12-10 09:33:08.768: E/AndroidRuntime(594): at pnu.cse.jjy.Main$1.onClick(Main.java:116)
12-10 09:33:08.768: E/AndroidRuntime(594): at android.view.View.performClick(View.java:3480)
12-10 09:33:08.768: E/AndroidRuntime(594): at android.view.View$PerformClick.run(View.java:13983)
12-10 09:33:08.768: E/AndroidRuntime(594): at android.os.Handler.handleCallback(Handler.java:605)
12-10 09:33:08.768: E/AndroidRuntime(594): at android.os.Handler.dispatchMessage(Handler.java:92)
12-10 09:33:08.768: E/AndroidRuntime(594): at android.os.Looper.loop(Looper.java:137)
12-10 09:33:08.768: E/AndroidRuntime(594): at android.app.ActivityThread.main(ActivityThread.java:4340)
12-10 09:33:08.768: E/AndroidRuntime(594): at java.lang.reflect.Method.invokeNative(Native Method)
12-10 09:33:08.768: E/AndroidRuntime(594): at java.lang.reflect.Method.invoke(Method.java:511)
12-10 09:33:08.768: E/AndroidRuntime(594): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
12-10 09:33:08.768: E/AndroidRuntime(594): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
12-10 09:33:08.768: E/AndroidRuntime(594): at dalvik.system.NativeStart.main(Native Method)
12-10 09:33:11.228: I/Process(594): Sending signal. PID: 594 SIG: 9

이런오류가 떠요;;


package pnu.cse.jjy;

import java.io.IOException;
import java.net.MalformedURLException;
import java.util.Calendar;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;

import android.app.Activity;
import android.app.AlarmManager;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.TimePicker;
import android.widget.Toast;

public class Main extends Activity implements RadioGroup.OnCheckedChangeListener {
/** Called when the activity is first created. */

TimePicker timePicker;

//int option=12;
RadioGroup radio;
EditText timein1;

@Override

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

Button process = (Button) findViewById(R.id.button1);
Button setting = (Button) findViewById(R.id.button2);
Button release = (Button) findViewById(R.id.button3);
radio = (RadioGroup) findViewById(R.id.radioGroup1);
radio.setOnCheckedChangeListener(this);

final TextView out1;
final TextView out2;
final TextView out3;
final TextView out4;

out1 = (TextView) findViewById(R.id.textView1);
out2 = (TextView) findViewById(R.id.textView3);
out3 = (TextView) findViewById(R.id.textView5);
out4 = (TextView) findViewById(R.id.textView6);
timein1 = (EditText) findViewById(R.id.editText1);


process.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View arg0) {

int outtime=12;//외출시간
int maxrate=0;
int maxtemp=0;
int mintemp=0;
int maxwind=0;

try {
outtime = Integer.parseInt(timein1.getText().toString());
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.parse("http://www.kma.go.kr/wid/queryDFSRSS.jsp?zone=4371034000");
Element root = doc.getDocumentElement();//root 
NodeList root_mem = root.getElementsByTagName("body");
Element body = (Element)root_mem.item(0);
NodeList data =  body.getElementsByTagName("data");

for(int i=0; i<(outtime+2)/3; i++){
Element point = (Element)data.item(i);//getElemetsBytagName을 쓰기위해 타입캐스팅

NodeList pops = point.getElementsByTagName("pop");
Element pop = (Element)pops.item(0);
Node txt=pop.getFirstChild();//내용 글도 하나의 node
if(Integer.parseInt(txt.getNodeValue())>maxrate)
maxrate = Integer.parseInt(txt.getNodeValue());
}
Log.d("result"," "+maxrate);
out1.setText("외출시간 동안 비가 올 최대 확률은 "+maxrate+"%입니다.");
for(int i=0; i<(outtime+2)/3; i++){
Element point = (Element)data.item(i);//getElemetsBytagName을 쓰기위해 타입캐스팅

NodeList tmxs = point.getElementsByTagName("tmx");
Element tmx = (Element)tmxs.item(1);
Node txt1=tmx.getFirstChild();
if(Integer.parseInt(txt1.getNodeValue())>maxtemp)
maxtemp = Integer.parseInt(txt1.getNodeValue());
}
Log.d("result"," "+maxtemp);
out2.setText("외출시간 동안 최고온도는 "+maxtemp+"도 입니다.");
for(int i=0; i<(outtime+2)/3; i++){
Element point = (Element)data.item(i);//getElemetsBytagName을 쓰기위해 타입캐스팅

NodeList tmns = point.getElementsByTagName("tmn");

Element tmn = (Element)tmns.item(2);
Node txt2=tmn.getFirstChild();
if(Integer.parseInt(txt2.getNodeValue())>mintemp)
mintemp = Integer.parseInt(txt2.getNodeValue());
}
Log.d("result"," "+mintemp);
out3.setText("외출시간 동안 최저온도는 "+mintemp+"%입니다.");
for(int i=0; i<(outtime+2)/3; i++){
Element point = (Element)data.item(i);//getElemetsBytagName을 쓰기위해 타입캐스팅

NodeList wss = point.getElementsByTagName("ws");

Element ws = (Element)wss.item(3);

Node txt3=ws.getFirstChild();

if(Integer.parseInt(txt3.getNodeValue())>maxwind)
maxwind = Integer.parseInt(txt3.getNodeValue());
}
Log.d("result"," "+maxwind);
out4.setText("외출시간 동안 최고풍속은 "+maxwind+"%입니다.");

} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (ParserConfigurationException e) {
e.printStackTrace();
} catch (SAXException e) {
e.printStackTrace();
}

}
});

setting.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {
Intent intent = new Intent(Main.this, AlarmReceiver.class);
PendingIntent sender = PendingIntent.getBroadcast(Main.this, 0, intent, 0);
//getbroadcast로 안하면 토스트가 안뜨네?

timePicker = (TimePicker) findViewById(R.id.timePicker1);                      

Calendar calendar = Calendar.getInstance();     
calendar.setTimeInMillis(System.currentTimeMillis());
Calendar nowcalendar = Calendar.getInstance();     
nowcalendar.setTimeInMillis(System.currentTimeMillis());

calendar.set(Calendar.HOUR_OF_DAY, timePicker.getCurrentHour());
calendar.set(Calendar.MINUTE, timePicker.getCurrentMinute());
calendar.set(Calendar.SECOND, 0);

if(nowcalendar.getTimeInMillis()>calendar.getTimeInMillis())
calendar.setTimeInMillis(calendar.getTimeInMillis()+1000*60*60*24);              

AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);
am.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), sender);

Toast toast = Toast.makeText(Main.this, "알람이 설정되었습니다.", Toast.LENGTH_LONG);
toast.show();

}
});


release.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {
AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);
Intent intent = new Intent(Main.this, AlarmReceiver.class);
PendingIntent pIntent = PendingIntent.getBroadcast(Main.this, 0, intent, 0);
am.cancel(pIntent);

Toast toast = Toast.makeText(Main.this, "알람이 해제되었습니다.", Toast.LENGTH_LONG);
toast.show();
}
});


}
public void onCheckedChanged(RadioGroup group, int checkedId) {
if(group==radio){
if (checkedId == R.id.radio0)
{
timein1.setText("2");
else if (checkedId == R.id.radio1){
timein1.setText("4");
}
else if (checkedId == R.id.radio2){
timein1.setText("6");
}
else if (checkedId == R.id.radio3){
timein1.setText("8");
}
else if (checkedId == R.id.radio4){
timein1.setText("12");
}

}
}
}


package pnu.cse.jjy;

import java.io.IOException;
import java.net.MalformedURLException;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;

import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.widget.Toast;

public class AlarmReceiver extends BroadcastReceiver {

@Override
public void onReceive(Context context, Intent intent) {
int outtime=12;//일단은 세팅시는 12시간 고정으로 처리
int maxrate=0;
int maxtemp=0;
int mintemp=0;
int maxwind=0;
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.parse("http://www.kma.go.kr/wid/queryDFSRSS.jsp?zone=4371034000");
Element root = doc.getDocumentElement();//root 
NodeList root_mem = root.getElementsByTagName("body");
Element body = (Element)root_mem.item(0);
NodeList data =  body.getElementsByTagName("data");

for(int i=0; i<(outtime+2)/3; i++){
Element point = (Element)data.item(i);//getElemetsBytagName을 쓰기위해 타입캐스팅

NodeList pops = point.getElementsByTagName("pop");
Element pop = (Element)pops.item(0);
Node txt=pop.getFirstChild();//내용 글도 하나의 node
if(Integer.parseInt(txt.getNodeValue())>maxrate)
maxrate = Integer.parseInt(txt.getNodeValue());
}
Toast.makeText(context, "앞으로 12시간 동안 비가 올 최대 확률은 "+maxrate+"%입니다.", Toast.LENGTH_LONG).show();
for(int i=0; i<(outtime+2)/3; i++){
Element point = (Element)data.item(i);//getElemetsBytagName을 쓰기위해 타입캐스팅

NodeList tmxs = point.getElementsByTagName("tmx");
Element tmx = (Element)tmxs.item(1);
Node txt1=tmx.getFirstChild();

if(Integer.parseInt(txt1.getNodeValue())>maxtemp)
maxtemp = Integer.parseInt(txt1.getNodeValue());
}
Toast.makeText(context, "앞으로 12시간 동안 최고온도는 "+maxtemp+"도 입 니다.", Toast.LENGTH_LONG).show();
for(int i=0; i<(outtime+2)/3; i++){
Element point = (Element)data.item(i);//getElemetsBytagName을 쓰기위해 타입캐스팅

NodeList tmns = point.getElementsByTagName("tmn");

Element tmn = (Element)tmns.item(2);
Node txt2=tmn.getFirstChild();
if(Integer.parseInt(txt2.getNodeValue())>mintemp)
mintemp = Integer.parseInt(txt2.getNodeValue());
}
Toast.makeText(context, "앞으로 12시간 동안 최저온도는 "+mintemp+"%입니다.", Toast.LENGTH_LONG).show();
for(int i=0; i<(outtime+2)/3; i++){
Element point = (Element)data.item(i);//getElemetsBytagName을 쓰기위해 타입캐스팅

NodeList wss = point.getElementsByTagName("ws");

Element ws = (Element)wss.item(3);

Node txt3=ws.getFirstChild();

if(Integer.parseInt(txt3.getNodeValue())>maxwind)
maxwind = Integer.parseInt(txt3.getNodeValue());
}
Toast.makeText(context, "앞으로 12시간 동안 최고풍속은 "+maxwind+"%입니다.", Toast.LENGTH_LONG).show();
int notification_icon = R.drawable.ic_launcher;
CharSequence tickerText = "날씨를 확인해주세요.";
CharSequence contentTitle = "날씨 알림";
CharSequence contentText = "날씨를 확인해주세요.";

Intent notificationIntent = new Intent(context,Noti.class);
PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0);

Notification notification = new Notification(notification_icon, tickerText, 0);
notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);

String ns = Context.NOTIFICATION_SERVICE;
NotificationManager mNotificationManager = (NotificationManager)context.getSystemService(ns);
mNotificationManager.notify(1,notification);
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (ParserConfigurationException e) {
e.printStackTrace();
} catch (SAXException e) {
e.printStackTrace();
}
}
}

package pnu.cse.jjy;

import java.io.IOException;
import java.net.MalformedURLException;
import java.util.Calendar;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;

import android.app.Activity;
import android.app.AlarmManager;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import android.widget.TimePicker;
import android.widget.Toast;

public class Noti extends Activity {

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
        setContentView(R.layout.noti);
TextView out1 = (TextView) findViewById(R.id.textView1);
TextView out2 = (TextView) findViewById(R.id.textView3);
TextView out3 = (TextView) findViewById(R.id.textView5);
TextView out4 = (TextView) findViewById(R.id.textView6);
Button conti = (Button) findViewById(R.id.button1);
Button exit = (Button) findViewById(R.id.button2);
int outtime=12;
int maxrate=0;
int maxtemp=0;
int mintemp=0;
int maxwind=0;
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.parse("http://www.kma.go.kr/wid/queryDFSRSS.jsp?zone=4371034000");
Element root = doc.getDocumentElement();//root 
NodeList root_mem = root.getElementsByTagName("body");
Element body = (Element)root_mem.item(0);
NodeList data =  body.getElementsByTagName("data");

for(int i=0; i<(outtime+2)/3; i++){
Element point = (Element)data.item(i);//getElemetsBytagName을 쓰기위해 타입캐스팅

NodeList pops = point.getElementsByTagName("pop");
Element pop = (Element)pops.item(0);

Node txt=pop.getFirstChild();//내용 글도 하나의 node
if(Integer.parseInt(txt.getNodeValue())>maxrate)
maxrate = Integer.parseInt(txt.getNodeValue());
}
Log.d("result"," "+maxrate);
out1.setText("외출시간 동안 비가 올 최대 확률은 "+maxrate+"%입니다.");
for(int i=0; i<(outtime+2)/3; i++){
Element point = (Element)data.item(i);//getElemetsBytagName을 쓰기위해 타입캐스팅

NodeList tmxs = point.getElementsByTagName("tmx");
Element tmx = (Element)tmxs.item(1);
Node txt1=tmx.getFirstChild();

if(Integer.parseInt(txt1.getNodeValue())>maxtemp)
maxtemp = Integer.parseInt(txt1.getNodeValue());
}
Log.d("result"," "+maxtemp);
out2.setText("외출시간 동안 최고온도는 "+maxtemp+"도 입니다.");
for(int i=0; i<(outtime+2)/3; i++){
Element point = (Element)data.item(i);//getElemetsBytagName을 쓰기위해 타입캐스팅

NodeList tmns = point.getElementsByTagName("tmn");

Element tmn = (Element)tmns.item(2);
Node txt2=tmn.getFirstChild();
if(Integer.parseInt(txt2.getNodeValue())>mintemp)
mintemp = Integer.parseInt(txt2.getNodeValue());
}
Log.d("result"," "+mintemp);
out3.setText("외출시간 동안 최저온도는 "+mintemp+"%입니다.");
for(int i=0; i<(outtime+2)/3; i++){
Element point = (Element)data.item(i);//getElemetsBytagName을 쓰기위해 타입캐스팅

NodeList wss = point.getElementsByTagName("ws");

Element ws = (Element)wss.item(3);

Node txt3=ws.getFirstChild();

if(Integer.parseInt(txt3.getNodeValue())>maxwind)
maxwind = Integer.parseInt(txt3.getNodeValue());
}
Log.d("result"," "+maxwind);
out4.setText("외출시간 동안 최고풍속은 "+maxwind+"%입니다.");
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (ParserConfigurationException e) {
e.printStackTrace();
} catch (SAXException e) {
e.printStackTrace();
}
        
        conti.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Noti.this, AlarmReceiver.class);
PendingIntent sender = PendingIntent.getBroadcast(Noti.this, 0, intent, 0);
//getbroadcast로 안하면 토스트가 안뜨네?                  
 
                Calendar calendar = Calendar.getInstance();     
calendar.setTimeInMillis(System.currentTimeMillis());
                
                calendar.setTimeInMillis(calendar.getTimeInMillis()+1000*60*60*24);              
//calendar.setTimeInMillis(calendar.getTimeInMillis()+1000*3);    
AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);
am.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), sender);
Toast toast = Toast.makeText(Noti.this, "알람이 설정되었습니다.", Toast.LENGTH_LONG);
toast.show();
int notification_icon = R.drawable.ic_launcher;
CharSequence tickerText = "날씨를 확인해주세요.";
CharSequence contentTitle = "날씨 알림";
CharSequence contentText = "날씨를 확인해주세요.";
Intent notificationIntent = new Intent(Noti.this,Noti.class);
       PendingIntent contentIntent = PendingIntent.getActivity(Noti.this, 0, notificationIntent, 0);
       
       Notification notification = new Notification(notification_icon, tickerText, 0);
       notification.setLatestEventInfo(Noti.this, contentTitle, contentText, contentIntent);
       
       String ns = Context.NOTIFICATION_SERVICE;
       NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);
       mNotificationManager.notify(1,notification);
}
});
        
        exit.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
        
}

}
이런 소스를 갖고 하는데 어디가문제인거죠??
메인쪽에 문제가 있는거 같은데 날씨확인키를 누르면 앱이종료가되버리네요;;