마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

여러 인텐트(intent)실행이 안됩니다ㅜㅜ도와주세요

0 추천

A- > B -> C -> D

이렇게 화면전환이 필요해서 인텐트를 써서 이전버튼, 다음버튼과 함께 구현하려고 하는데요.

문제는 처음 메인화면에서 A로 넘어가고 B까지로도 잘넘어가지는데 C로 넘어가려고 하면 잠시 화면이 멈추었다가

A로 다시 넘어옵니다. 뭐가 문제인지 잘 모르겠어요 ㅠㅠ 고수님들 도와주세요.

 

 

메니페스트

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.date.datemaker"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="19" />

    <uses-permission android:name="android.permission.INTERNET" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.date.datemaker.MainActivity"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <meta-data
            android:name="com.facebook.sdk.ApplicationId"
            android:value="@string/app_id" />

        <activity android:name="com.facebook.LoginActivity"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
        </activity>
        <activity android:name="LoginActivity_facebook"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
            
          </activity>
        <activity android:name="Intro1"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
            
        </activity>
        <activity android:name="Intro2"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
        </activity>
        <activity android:name="Intro3"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
            
        </activity>
        <activity android:name="Intro4"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
            
        </activity>
    </application>

</manifest>

액티비티

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class Intro1 extends Activity{

	Button nextbtn1;
	Button beforebtn1;
	
	   @Override
	    protected void onCreate(Bundle savedInstanceState) {
	        super.onCreate(savedInstanceState);
	        setContentView(R.layout.intro1);
	        
	        nextbtn1 = (Button)findViewById(R.id.nextbtn1);
	        beforebtn1 =(Button)findViewById(R.id.beforebtn1);
			
	        nextbtn1.setOnClickListener(new View.OnClickListener() {
				
				@Override
				public void onClick(View v) {
					// TODO Auto-generated method stub
					Intent nextintent1 = new Intent(Intro1.this,Intro2.class);
					startActivity(nextintent1);
				}
			}); 
	        
	        beforebtn1.setOnClickListener(new View.OnClickListener() {
				
				@Override
				public void onClick(View v) {
					// TODO Auto-generated method stub
					Intent beforeintent1 = new Intent(Intro1.this, MainActivity.class);
					startActivity(beforeintent1);
				}
			});
	   
	   }
	    
}

XML

 

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/RelativeLayout1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/intro1"
    android:orientation="vertical" >

    <Button
        android:id="@+id/nextbtn1"
        style="?android:attr/buttonStyleSmall"
        android:layout_width="90dp"
        android:layout_height="30dp"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:layout_marginBottom="86dp"
        android:layout_marginRight="21dp"
        android:background="@drawable/intronext"
        android:text="" />

    <Button
        android:id="@+id/beforebtn1"
        style="?android:attr/buttonStyleSmall"
        android:layout_width="90dp"
        android:layout_height="30dp"
        android:layout_alignBaseline="@+id/nextbtn1"
        android:layout_alignBottom="@+id/nextbtn1"
        android:layout_alignParentLeft="true"
        android:layout_marginLeft="22dp"
        android:background="@drawable/introbefore"
        android:text="" />

</RelativeLayout>

 

intro 2, 3, 4도 위와 비슷하구요(인텐트에서 넘어갈때 .this와 .class부분과 intent명, 버튼이름이 다름-> 혹시나 해서 바꿔봤어요 ㅠㅠ 문제가 뭘까요?!)

 

 

고수님들 제발 도와주세요

개굴이 (220 포인트) 님이 2014년 6월 9일 질문
개굴이님이 2014년 6월 9일 수정

2개의 답변

0 추천
매니페스트 보니까 B페이지로 추정되는 intro2 부분에만 인텐트 필터 처리가 되어있는데 다른데는 없네요..혹시 이부분이 문제가 아닐까요
anci (19,950 포인트) 님이 2014년 6월 9일 답변
ㅠㅠ고쳤는데도 해결이 안되네요!ㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠ
0 추천
MainActivity를 제외하고 intent-filter를 다 지워보세요~
YeonMin (17,860 포인트) 님이 2014년 6월 9일 답변
ㅠㅠ 다 지웠는데도 해결이 안되네요 ㅠㅠ
일단 before버튼쪽에는 startActivity보다는 finish를 하는게 맞는거 같구요.. 그리고 매니페스트 쪽에 액티비티 네임들이 이상합니다..패키지 명까지 풀네임을 적어보세요..그리고 intent쪽과 next버튼쪽에 소스를 찬찬히 한번 보시기 바랍니다..문제를 잘 모르겠으면 풀소스 부탁합니다.
...