안드로이드 졸작을 하는중인데요....
이게 알람을 설정하면 알람을 해제 할때 TTS를 실행할려고 해서
알람 셋팅 후 TTS 세팅을하고 intent로 알람보이는부분으로 ㄴstring을 보낼려고 햇거든요
알람 셋팅후 tts 셋팅으로 버튼을 누르고 넘어갈려고 하니 에러가 나고 이런 log가 뜨네요
제가 아직 초보라 이게 먼뜻인지 잘모르는데... 어디가 문제 인가요?
package com.garamsoft.alarm;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.speech.tts.TextToSpeech;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
public class TTS extends Activity implements OnClickListener {
Button tv;
EditText et;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button tv = (Button)findViewById(R.id.button1);
tv.setOnClickListener(this);
}
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
EditText et = (EditText)findViewById(R.id.editText1);
String str=et.getText().toString();
Intent it = new Intent(this,ActivityAlarmedTimeShow.class);
//it.putExtra("str", str);
it.getExtras().getString("str");
finish();
}
}
10-29 15:29:41.555: E/AndroidRuntime(456): at android.app.ActivityThread.access$600(ActivityThread.java:130)
10-29 15:29:41.555: E/AndroidRuntime(456): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
10-29 15:29:41.555: E/AndroidRuntime(456): at android.os.Handler.dispatchMessage(Handler.java:99)
10-29 15:29:41.555: E/AndroidRuntime(456): at android.os.Looper.loop(Looper.java:137)
10-29 15:29:41.555: E/AndroidRuntime(456): at android.app.ActivityThread.main(ActivityThread.java:4745)
10-29 15:29:41.555: E/AndroidRuntime(456): at java.lang.reflect.Method.invokeNative(Native Method)
10-29 15:29:41.555: E/AndroidRuntime(456): at java.lang.reflect.Method.invoke(Method.java:511)
10-29 15:29:41.555: E/AndroidRuntime(456): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
10-29 15:29:41.555: E/AndroidRuntime(456): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
10-29 15:29:41.555: E/AndroidRuntime(456): at dalvik.system.NativeStart.main(Native Method)
10-29 15:29:41.555: E/AndroidRuntime(456): Caused by: java.lang.NullPointerException
10-29 15:29:41.555: E/AndroidRuntime(456): at com.garamsoft.alarm.TTS.onCreate(TTS.java:21)
10-29 15:29:41.555: E/AndroidRuntime(456): at android.app.Activity.performCreate(Activity.java:5008)
10-29 15:29:41.555: E/AndroidRuntime(456): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
10-29 15:29:41.555: E/AndroidRuntime(456): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)