简体   繁体   中英

3 ImageButtons onClick opens same activity

我有3个ImageButton ,它们应该打开不同的活动,但是每次都打开相同的活动。

Why are you using

BaseTabGroup parentActivity = (BaseTabGroup)getParent();
            parentActivity.startChildActivity("Engines", edit);

Just use

startActivity(intent);

See: http://developer.android.com/training/basics/firstapp/starting-activity.html

Your problem could also be inside the layout though.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM