开发者

Activity group throw ActivityNotFoundException?

I want to change the cur开发者_Python百科rent activity inside a tab in a tab activity,

after some research, I know that I need to use activity group to go this.

then I created a new class extends ActivityGroup with the code below:

public class FavShop extends ActivityGroup{
 protected void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       LocalActivityManager m = getLocalActivityManager();
       Intent i = new Intent(this, fav_shops.class);
       Window window = m.startActivity("favourite shop",i);
       setContentView(window.getDecorView()); 
  }
 }

then I run the program, the program throw the ActivityNotFoundException when the intent for the tab is launched

I have no idea how to solve this problem, could anyone help me?


Did you describe your new Activity in your AndroidManifest.xml? I forget to do that nearly every time I create an Activity.


The solution which worked for me is to CLEAN the project.

In Eclipse, Menu (Project) > Select Clean Once done, compile and run the project.

See if it works. It is weird though.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜