Android use ActivityForResult in ArrayAdapter with AlertDialog -
After
In my ArrayAdapter
I have a AlertDialog
with a button . Now I want to use the ActivityForResult
for this simple code I can use a intent
to see other activity
, but I In the ArrayAdapter
the data can not pass from it.
Public Class AdapterReceiveSMS ArrayAdapter & lt Spread ReceivedItemStructure & gt; {Private myDialog dialogue; Public AdapterReceiveSMS (ArrayList & lt; ReceivedItemStructure & gt; Array) {Super (G.context, R.layout.rsms, array); } / * ----- Forward Button ----- * / forward_button.setOnClickListener (New View.OnClickListener () {@Override Public Zero onClick (see v) {AlertDialog.Builder Builder = New AlertDialog.builder click on From (G.activityDialogContext); see vForward = G.inflater.inflate (R.layout.forward, tap); builder.setView (vForward); Last AlertDialog sms_dialog = builder.create (); sms_dialog.show (); from_file SetOnClickListener (see the new OnClickListener () {@Override click on Public Zero (see V) {intent filebrowser = new intent (live activation, activity file world class); live activation.artactivityfororisult (FE Browser, 1);}})}} Public Zero OnActivityResult (int RequestCode, Filled result code, Intent data) {ifCode == 1} {}}
Paragraph activity class and it is said that when you started an activity, you requested that you have started it, as a result it was returned. , And any extra data from it "
You started the activity using this code
G. activation. StartActivityForeserve (file browser, 1);
You must put your activation specific method into your calling activity (I mean activity in which you are creating an object of Adapter Receiving SMS Class.)
Comments
Post a Comment