Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I've an activity WelcomeActivity.java in which theres a button bContinue. In the OnClick method of the button, I tried this..

startActivity(new Intent(this, MenuItemDetailActivity.class));
//startActivity(new Intent("com.resto.demo.activity.MENUITEMLISTACTIVITY"));

neither of the above 2 lines work. instead they give me NullPointerException & the program ends abruptly..I cant find the problem.. is the problem in manifest or my call?

<activity
   android:name="com.resto.demo.activity.MenuItemListActivity"
   android:label="@string/title_menuitem_list" >
   <intent-filter>
       <action android:name="com.resto.demo.activity.MENUITEMLISTACTIVITY" />
       <category android:name="android.intent.category.DEFAULT" />
   </intent-filter>
</activity>

MenuItemListActivity is the part of master/detail flow. Thanx you. Also tell me if my problem is not understood. Any help/suggestion is welcome :)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
165 views
Welcome To Ask or Share your Answers For Others

1 Answer

Edit your manifest

 <application 
    <activity
       android:name="com.resto.demo.activity.MenuItemListActivity"
       android:label="@string/title_menuitem_list" >
       <intent-filter>
           <action android:name="com.resto.demo.activity.MENUITEMLISTACTIVITY" />
           <category android:name="android.intent.category.DEFAULT" />
       </intent-filter>
    </activity>
    <activity android:name="com.resto.demo.activity.MenuItemDetailActivity"/>
 </application>

And add this to OnClick event

startActivity(new Intent(MenuItemListActivity.this, MenuItemDetailActivity.class));

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...