android - display Two activity on Same screen -
i working on android 3.0 need divide screen on 2 parts 1 part should attached under activity , second actvity b, how possible? tried using fragment fragment attached 1 activity. challenge 2 activtiy.
@override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { // todo auto-generated method stub view view = inflater.inflate(r.layout.fragment1, container, false); button button = (button)view.findviewbyid(r.id.button1); button.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { // todo auto-generated method stub intent intent = new intent(getactivity() , a.class); intent.setflags(intent.flag_activity_clear_task); startactivity(intent); } }); return view; }
you cannot. purpose need use fragment
, designed for. screen estate on mobile devices limited, hence, design choice not support multiple activities sharing screen.
if think require 2 activities, suggest rethink design. if need functionality in addition 1 activity can offer, suggest using service
. more details on why made design choice have been helpful.
Comments
Post a Comment