다른 부분은 다 동작이 되는데 앱이 꺼져버리는 부분은 간단한 버튼이벤트에서 다음 페이지로 넘어가지를 않습니다.
계속 봐도 오류도 없고 어느부분인지 모르겠고 로그캣을 보고서는 어떤 오류인지 모르겠어요..ㅠㅠ
result1에서 tip페이지로 넘어가는 버튼을 누르면 앱이 종료됩니다.
result1.java
package project.smartpwd;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
public class result1 extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.result1);
ImageButton a = (ImageButton)findViewById(R.id.TipBtn);
a.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
Intent i;
i=new Intent(result1.this,tip.class);
startActivity(i);
}
});
ImageButton b = (ImageButton)findViewById(R.id.CloseBtn);
b.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
Intent i;
i=new Intent(result1.this,check.class);
startActivity(i);
}
});
ImageButton c = (ImageButton)findViewById(R.id.HomeBtn);
c.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
Intent i;
i=new Intent(result1.this,menu.class);
startActivity(i);
}
});
// TODO Auto-generated method stub
}
}
그리고 tip.java
package project.smartpwd;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
public class tip extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.tip);
ImageButton a = (ImageButton)findViewById(R.id.HomeBtn);
a.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
Intent i;
i=new Intent(tip.this,menu.class);
startActivity(i);
}
});
ImageButton b = (ImageButton)findViewById(R.id.CloseBtn);
b.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
Intent i;
i=new Intent(tip.this,result1.class);
startActivity(i);
}
});
// TODO Auto-generated method stub
}
}
혹시 몰라 manifestfile도 첨부합니다.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="project.smartpwd"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name="smartpwd"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="menu"
android:label="menu" />
<activity android:name="test1"></activity>
<activity android:name="result2"
android:label="@string/helpme_title"
android:theme="@android:style/Theme.Dialog"
android:configChanges="keyboardHidden|orientation"></activity>
<activity android:name="result3"
android:theme="@android:style/Theme.Dialog"
android:label="@string/helpme_title2"
android:configChanges="keyboardHidden|orientation"></activity>
<activity android:name="result4"
android:theme="@android:style/Theme.Dialog"
android:label="@string/helpme_title3"
android:configChanges="keyboardHidden|orientation"></activity>
<activity android:name="result5"
android:theme="@android:style/Theme.Dialog"
android:label="@string/helpme_title4"
android:configChanges="keyboardHidden|orientation"></activity>
<activity android:name="result6"
android:theme="@android:style/Theme.Dialog"
android:label="@string/helpme_title5"
android:configChanges="keyboardHidden|orientation"></activity>
<activity android:name="result1"></activity>
<activity android:name="link"></activity>
<activity android:name="check"></activity>
<activity android:name="tip"></activity>
<activity android:name="link1"></activity>
<activity android:name="link2"></activity>
<activity android:name="link3"></activity>
</application>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
</manifest>
조언 좀 부탁드릴게요..ㅠㅠㅠ 수고하세요^^




public void onClick(View v) { 요기서 널포인터 예외 뜨는데요
b.setOnClickListener(new Button.OnClickListener() { 를
b.setOnClickListener(new OnClickListener() {
이렇게 해보세요