2012-07-13 6 views
0

AdMob을 실행할 때마다 앱을 실행할 때마다 광고가있는 페이지로 이동하는 단추를 클릭 할 때마다 "잡히지 않는 예외로 스레드가 종료됩니다. 그룹 = 0x40a3b1f8) "잡히지 않은 예외 (그룹 = 0x40a3b1f8)로 끝나는 스레드

홈페이지 자바 :

package com.co500.gdsg; 

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

public class GameDevStoryGuideActivity extends Activity { 
    /** Called when the activity is first created. */ 
    @Override 
    public void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.main); 

     Button co = (Button) findViewById(R.id.combinations); 
     co.setOnClickListener(new View.OnClickListener() { 

      public void onClick(View v) { 
       // TODO Auto-generated method stub 
       startActivity(new Intent("com.co500.gdsg.COMBINATIONS")); 
      } 
     }); 

     Button jb = (Button) findViewById(R.id.jobs); 
     jb.setOnClickListener(new View.OnClickListener() { 

      public void onClick(View v) { 
       // TODO Auto-generated method stub 
       startActivity(new Intent("com.co500.gdsg.JOBS")); 
      } 
     }); 

     Button ty = (Button) findViewById(R.id.type); 
     ty.setOnClickListener(new View.OnClickListener() { 

      public void onClick(View v) { 
       // TODO Auto-generated method stub 
       startActivity(new Intent("com.co500.gdsg.TYPE")); 
      } 
     }); 

     Button con = (Button) findViewById(R.id.consoles); 
     con.setOnClickListener(new View.OnClickListener() { 

      public void onClick(View v) { 
       // TODO Auto-generated method stub 
       startActivity(new Intent("com.co500.gdsg.CONSOLES")); 
      } 
     }); 

     Button gen = (Button) findViewById(R.id.genre); 
     gen.setOnClickListener(new View.OnClickListener() { 

      public void onClick(View v) { 
       // TODO Auto-generated method stub 
       startActivity(new Intent("com.co500.gdsg.GENRE")); 
      } 
     }); 
    } 
} 

매니페스트

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    android:installLocation="preferExternal" 
    package="com.co500.gdsg" 
    android:versionCode="1" 
    android:versionName="1.0" > 
    <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" />/> 
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> 
    <uses-permission android:name="android.permission.INTERNET"/> 

    <application 
     android:icon="@drawable/ic_launcher" 
     android:label="@string/app_name" > 
     <activity 
     android:name="com.google.ads.AdActivity" 
     android:configChanges="orientation|keyboard|keyboardHidden|screenLayout|uiMode|screenSize|smallestScreenSize" 
     ></activity> 
     <activity 
      android:name=".GameDevStoryGuideActivity" 
      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=".Genre" 
      android:label="@string/app_name" > 
      <intent-filter> 
       <action android:name="com.co500.gdsg.GENRE" /> 
       <category android:name="android.intent.category.DEFAULT" /> 
      </intent-filter> 
     </activity> 
     <activity 
      android:name=".Combinations" 
      android:label="@string/app_name" > 
      <intent-filter> 
       <action android:name="com.co500.gdsg.COMBINATIONS" /> 
       <category android:name="android.intent.category.DEFAULT" /> 
      </intent-filter> 
     </activity> 
     <activity 
      android:name=".Consoles" 
      android:label="@string/app_name" > 
      <intent-filter> 
       <action android:name="com.co500.gdsg.CONSOLES" /> 
       <category android:name="android.intent.category.DEFAULT" /> 
      </intent-filter> 
     </activity> 
     <activity 
      android:name=".Notgood" 
      android:label="@string/app_name" > 
      <intent-filter> 
       <action android:name="com.co500.gdsg.NOTGOOD" /> 
       <category android:name="android.intent.category.DEFAULT" /> 
      </intent-filter> 
     </activity> 
     <activity 
      android:name=".Hmm" 
      android:label="@string/app_name" > 
      <intent-filter> 
       <action android:name="com.co500.gdsg.HMM" /> 
       <category android:name="android.intent.category.DEFAULT" /> 
      </intent-filter> 
     </activity> 
     <activity 
      android:name=".Notbad" 
      android:label="@string/app_name" > 
      <intent-filter> 
       <action android:name="com.co500.gdsg.NOTBAD" /> 
       <category android:name="android.intent.category.DEFAULT" /> 
      </intent-filter> 
     </activity> 
     <activity 
      android:name=".Creative" 
      android:label="@string/app_name" > 
      <intent-filter> 
       <action android:name="com.co500.gdsg.CREATIVE" /> 
       <category android:name="android.intent.category.DEFAULT" /> 
      </intent-filter> 
     </activity> 
     <activity 
      android:name=".Amazing" 
      android:label="@string/app_name" > 
      <intent-filter> 
       <action android:name="com.co500.gdsg.AMAZING" /> 
       <category android:name="android.intent.category.DEFAULT" /> 
      </intent-filter> 
     </activity> 
     <activity 
      android:name=".Jobs" 
      android:label="@string/app_name" > 
      <intent-filter> 
       <action android:name="com.co500.gdsg.JOBS" /> 
       <category android:name="android.intent.category.DEFAULT" /> 
      </intent-filter> 
     </activity> 
     <activity 
      android:name=".Type" 
      android:label="@string/app_name" > 
      <intent-filter> 
       <action android:name="com.co500.gdsg.TYPE" /> 
       <category android:name="android.intent.category.DEFAULT" /> 
      </intent-filter> 
     </activity> 
    </application> 

</manifest> 

main.xml에

,536,913 (다른 XMLS 유사) 63,210
<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="@drawable/background" 
    android:gravity="center" 
    android:orientation="vertical" > 

    <Button 
     android:id="@+id/genre" 
     android:layout_width="148dp" 
     android:layout_height="wrap_content" 
     android:text="Game Genre Unlocks" /> 

    <Button 
     android:id="@+id/consoles" 
     android:layout_width="148dp" 
     android:layout_height="wrap_content" 
     android:text="Consoles" /> 

    <Button 
     android:id="@+id/combinations" 
     android:layout_width="148dp" 
     android:layout_height="wrap_content" 
     android:text="Combinations" /> 


    <Button 
     android:id="@+id/type" 
     android:layout_width="148dp" 
     android:layout_height="wrap_content" 
     android:text="Game Type Unlocks" /> 

    <Button 
     android:id="@+id/jobs" 
     android:layout_width="148dp" 
     android:layout_height="wrap_content" 
     android:text="Jobs" /> 

</LinearLayout> 

consoles.xml

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:orientation="vertical" > 

<ScrollView android:layout_width="fill_parent" android:layout_height="fill_parent"> 

<LinearLayout 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:orientation="vertical" > 

    <ImageView 
     android:id="@+id/imageView1" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:src="@drawable/consoleavail" /> 

    </LinearLayout> 
</ScrollView> 
<com.google.ads.AdView android:id="@+id/adView" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentBottom="true" 
    ads:adUnitId="empty for a reason" 
    ads:adSize="BANNER" 
    ads:loadAdOnCreate="true"/> 
</RelativeLayout> 

로그 캣 :

07-13 15:16:13.770: D/dalvikvm(4567): GC_FOR_ALLOC freed 17K, 2% free 7848K/8007K, paused 14ms 
07-13 15:16:13.780: I/dalvikvm-heap(4567): Grow heap (frag case) to 9.377MB for 1769056-byte allocation 
07-13 15:16:13.810: D/dalvikvm(4567): GC_CONCURRENT freed 2K, 2% free 9573K/9735K, paused 2ms+2ms 
07-13 15:16:13.830: D/AndroidRuntime(4567): Shutting down VM 
07-13 15:16:13.830: W/dalvikvm(4567): threadid=1: thread exiting with uncaught exception (group=0x40a3b1f8) 
07-13 15:16:13.830: E/AndroidRuntime(4567): FATAL EXCEPTION: main 
07-13 15:16:13.830: E/AndroidRuntime(4567): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.co500.gdsg/com.co500.gdsg.Consoles}: android.view.InflateException: Binary XML file line #23: Error inflating class com.google.ads.AdView 
07-13 15:16:13.830: E/AndroidRuntime(4567):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956) 
07-13 15:16:13.830: E/AndroidRuntime(4567):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981) 
+2

logcat을 게시하십시오. – Egor

+0

admob lib를 올바르게 추가 했습니까? – AMerle

+0

Referenced Libraries의 예가 – Co500

답변

0

당신은 문제를 일으키는 문

startActivity(new Intent("com.co500.gdsg.CONSOLES")); 

미만이 사용하고 있습니다.

사용

startActivity(new Intent(ActivityName.this,CONSOLES.class); 
컨텍스트와 className.this해야한다 둘째해야 의도

첫 PARAM는 대상 클래스에게 있습니다

PS : - 그것을 찾을 수 없습니다 ActivityName 같은 오류가 표시됩니다, 교체하십시오 활동 이름과 활동 이름.

+0

당신의 의도 생성자가 존재하지 않습니다, 당신은 새로운 의도 (문맥, 클래스)에 대해 얘기하고있는 것 같아요 – AMerle

+0

내가 "내가 할당하면 왼쪽에 할당이 변수가 있어야합니다"및 "구문 오류 on token "또는", invalid AssignmentOperator "또는 – Co500

+0

guys ..이 글이나 activityName을 사용하도록 알려주었습니다. 이해가되지 않을 수도 있습니다. 내 asnwer 업데이트 – AAnkit

관련 문제