제가 Unfortunately, has stopped 때문에..하루종일 머리 싸매고 있는데 오류를 못찾겠습니다..
제 부족함을 탓해야죠. 혹시 아래 코드에서 에러발생요인을 아시면 적어주세요.
부탁드립니다.
FirstActivity.java
---------------------------------------------------------------------------------------
package com.example.libraryinfoapps;
import android.app.Activity;
import android.os.Bundle;
import android.content.Intent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;
public class FirstActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_first);
Button button=(Button)findViewById(R.id.first_btn);
button.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View v){
Toast.makeText(getApplicationContext(),"액티비티 전환" ,Toast.LENGTH_LONG).show();
Intent intent=new Intent(getApplicationContext(), SecondActivity.class);
startActivity(intent);
}
});
-----------------------------------------------------------------------------------
SecondActivity.java
-----------------------------------------------------------------------------------
package com.example.libraryinfoapps;
import android.app.Activity;
import android.os.Bundle;
public class SecondActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_second);
// TODO Auto-generated method stub
}
}
---------------------------------------------------------------------------------------
activity_first.xml
---------------------------------------------------------------------------------------
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation = "vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<Button
android:id="@+id/first_btn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="let's START"
android:textSize="15sp"
/>
< /LinearLayout>
---------------------------------------------------------------------------------------
activity_second.xml
---------------------------------------------------------------------------------------
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<textView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="두번째화면"
android:textSize="15sp"
/>
</LinearLayout>
대체 무슨오류인지 모르겠습니다.