开发者

How to pass from an interface to other in Android

I'm a beginner in Android. I 开发者_如何学Pythoncreated two interfaces with DroiDraw, then I added them res/layout/a.xml and res/layout/b.xml

My goal is passing from interface a to b.

How can I do??


If you want to pass data from Activity A to ActivityB, then add it to the Intent that starts Activity B

Intent i = new Intent(this,ActivityB.class);
i.putExtra("key",value);
startActivity(i);

Also have a look at the Bundle class.


If passing means "passing data" - look into SharedPreferences or Sqlite - it depends upon your options If Passing means "navigating" - associate an activity with interface b - so launch activity b when the user wants to navigate to it from interface a.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜