2009-10-09 3 views
0

Android에서 새 응용 프로그램을 시작하려면 어떻게해야합니까? 새로운 응용 프로그램 인 NewHomeScreen과 Hello를 작성했으며 NewHomeScreen에서이 코드를 작성했습니다.Android에서 새 응용 프로그램을 시작하는 방법

@Override public void onCreate(Bundle state) { 
    super.onCreate(state); 
    setContentView(R.layout.main); 
    Intent mainIntent = new Intent(this,Hello.class); 
    startActivity(mainIntent); 
} 

그러나 Hello 응용 프로그램을 시작하지 않습니다. 디버거에서는 상태 값이 null이지만 그 값은 무엇이되어야한다고 말합니까? 또한이 매니페스트 쓴 :

<activity android:name="Hello"> 
    <intent-filter> 
      <action android:name="android.intent.action.HELLO" /> 
      <category android:name="android.intent.category.HELLO"/> 
      <category android:name="android.intent.category.DEFAULT" /> 
    </intent-filter> 
</activity> 
+0

실제 logcat 출력을 붙여 넣을 수 있습니까? – Intrications

답변

0

가 홈 활동에 의도 필터 제거하기보십시오. 기본 화면이 아니라면 어쨌든 필요하지 않습니다.

0

나는 당신이 당신의 AndroidManifest.xml 파일의 주요 활동을 지정하는 것을 잊었다 생각 :

<application android:icon="@drawable/icon"> 
    <activity android:name="NewHomeScreen" android:label="@string/app_name"> 
     <intent-filter> 
      <action android:name="android.intent.action.HELLO" /> 
      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 
</application> 
+0

추가하면 도움이되지 않습니다. –

관련 문제