Reputation: 149
I am using Intent.Action.Send for Send data like(image,text).I want Result Data Send or not but onActivityResult is not working.Please check the code .help me . Get Error:-
01-25 19:12:49.160 140-19149/? E/DrmMtkUtil/DrmUtil: checkDcf: not dcf type, dcf version value [80]
01-25 19:12:49.160 140-19149/? E/DrmMtkUtil/DrmUtil: checkDcf: not dcf type, dcf version value [80]
01-25 19:12:49.161 140-19149/? E/DrmMtkUtil/DrmUtil: checkDcf: not dcf type, dcf version value [80]
01-25 19:12:49.164 139-139/? E/DrmMtkUtil/DrmUtil: parseDcf: not dcf type, dcf version value [80]
01-25 19:12:49.164 139-139/? E/DrmMtkPlugIn: onOpenDecryptSession() : failed to parse dcf file.
01-25 19:12:49.192 140-19149/? E/AsfParser: unknown object: 20000000-7466-7079-4d34412000000000, 541144141 bytes
01-25 19:12:49.192 140-19149/? E/AsfParser: error parsing header: -6
01-25 19:12:49.198 140-27751/? E/MtkOmxAudioDecBase: MtkOmxAudioDecBase:SetParameter unsupported nParamIndex(0x7F00001E)
01-25 19:12:49.200 140-27751/? E/OMXCodec: @@ [OUT] def.nBufferSize = 24576
01-25 19:12:49.200 140-27751/? E/OMXCodec: @@ [OUT] totalSize = 221696
01-25 19:12:49.201 27103-27103/? E/MediaPlayer: Should have subtitle controller already set
01-25 19:12:49.203 140-16861/? E/OMXCodec: [OMX.MTK.AUDIO.DECODER.AAC] +waitForBufferFilled_l: 4/0
01-25 19:12:49.204 140-27754/? E/OMXCodec: @@ [OUT] def.nBufferSize = 24576
01-25 19:12:49.204 140-27754/? E/OMXCodec: @@ [OUT] totalSize = 221696
01-25 19:12:49.205 140-16861/? E/OMXCodec: [OMX.MTK.AUDIO.DECODER.AAC] -waitForBufferFilled_l
01-25 19:12:49.205 140-16861/? E/OMXCodec: [OMX.MTK.AUDIO.DECODER.AAC] +waitForBufferFilled_l: 6/0
01-25 19:12:49.206 140-16861/? E/OMXCodec: [OMX.MTK.AUDIO.DECODER.AAC] -waitForBufferFilled_l
01-25 19:12:49.208 140-27755/? E/OMXCodec: [OMX.MTK.AUDIO.DECODER.AAC] No more output data in fillOutputBuffer, mFilledBuffers size=3
01-25 19:12:49.208 140-27755/? E/OMXCodec: [OMX.MTK.AUDIO.DECODER.AAC] No more output data in fillOutputBuffer, mFilledBuffers size=2
01-25 19:12:49.208 140-27755/? E/OMXCodec: [OMX.MTK.AUDIO.DECODER.AAC] No more output data in fillOutputBuffer, mFilledBuffers size=1
01-25 19:12:49.208 140-27755/? E/OMXCodec: [OMX.MTK.AUDIO.DECODER.AAC] No more output data in fillOutputBuffer, mFilledBuffers size=0
01-25 19:12:49.208 140-27755/? E/OMXCodec: [OMX.MTK.AUDIO.DECODER.AAC] read() final return
Adapter Class:-
holder.shareRL.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String des = eventlist.get(position).get("Description");
String location = eventlist.get(position).get("location");
String time = eventlist.get(position).get("Event_date_time");
String title = eventlist.get(position).get("Event_title");
intent_str = "Event Show " + "\n " + title + " \n" + time + "\n" + location + "\n" + des;
TredingFragment.Share_intent((Activity) mContext);
}
TredingFragment class :-
public static void Share_intent(Activity activity) {
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, Eventlist_adapter.intent_str);
//activity.setResult(Activity.RESULT_OK,intent);
activity.startActivityForResult(Intent.createChooser(intent, "Share and earn a extra Priviledge"), 111);
}
onActivityResult
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
// super.onActivityResult(requestCode, resultCode, data);
Log.e("code", REQUEST_FOR_ACTIVITY_CODE + "");
Log.e("result", requestCode + "");
Log.e("result", resultCode + "");
if (requestCode == 111) {
if (resultCode == Activity.RESULT_OK) {
Log.e("result", "okkkk" + "");
// Toast.makeText(this, "Ok DUDE", Toast.LENGTH_LONG).show();
} else if (resultCode == Activity.RESULT_CANCELED) {
// Toast.makeText(this, "Oversmart Eh!!", Toast.LENGTH_LONG).show();
Log.e("result", "okkk" + "");
}
}
}
Upvotes: 1
Views: 1137
Reputation: 3574
App which is opened through ACTION_SEND
intent does not close by itself unless the user presses Back
button. So there is not use of waiting for result from that Intent
.
Upvotes: 0
Reputation: 1007276
ACTION_SEND
does not return a result ("Output: nothing" in the documentation), and so it is pointless to use it with startActivityForResult()
.
Upvotes: 1