2016-09-20 9 views
0

インテントエラーを処理するアクティビティが見つかりませんか?それがどのように解決するか。インテントを処理するアクティビティが見つかりません{act = com.example.kai.chloe.Menu}

<activity android:name=".Menu"android:label="@string/app_name"></activity> 
    <intent-filter> 
     <action android:name="com.example.kai.chloe.Menu" /> 

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

マニフェストファイル

Intent intent=new Intent("com.example.kai.chloe.Menu"); 
startActivity(intent);} 

ログインページ

+1

なぜ 'new Intent(this、Menu.class)'を使わないのですか? –

+0

合意。自分自身でそのアクティビティを開始する他のアプリケーションを計画している場合を除き、 '<インテントフィルタ>'をアクティビティに配置しないでください。また、Androidには 'Menu'という名前のクラスがあるので、あなたのクラスに何か他の名前を付けてください。そうしないと、クラス名の参照(インポートなど)に問題が発生する可能性があります。 – CommonsWare

答えて

0
Intent startMenu = new Intent(this, Menu.class); 
startActivity(startMenu); 

私はこのようにそれを行うだろうと<intent-filter>を使用しないでください。

Intent intent = new Intent(getApplicationContext(), Menu.class); 
startActivity(intent); 

そして、あなたは<activity>タグの中に置く必要があり<intent-filter>タグ:

0

は、このテントのコードを使用してください。

関連する問題