How to use same android button to start an activity and do a function in previous activity? -
i have sms application.here wish use send button send sms in activity move on new activity.i have written code send sms.but dono how go activity @ same time.kindly help.this code.
btn.setonclicklistener(new view.onclicklistener() { @override public void onclick(view arg0) { string mobileno=pno.gettext().tostring(); string text=msg.gettext().tostring(); sentsms(mobileno,text); } });
use this:
intent intent = new intent(this, yoursecondactivity.class); startactivity(intent);
in onclick, be:
btn.setonclicklistener(new view.onclicklistener() { @override public void onclick(view arg0) { string mobileno=pno.gettext().tostring(); string text=msg.gettext().tostring(); sentsms(mobileno,text); intent intent = new intent(this, yoursecondactivity.class); startactivity(intent); } });
Comments
Post a Comment