1

I am trying to access and pick a sound from the android music galley . This is what I have implemented :

Intent intent = new Intent();
intent.setType("audio/*");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setAction(Intent.ACTION_GET_CONTENT);

But the problem is with the startActivityForResult. Here I want to startActivityForResult on other activity say testActivity which is not accessible to me . so my next line is :

testActivity.getActivity().startActivityForResult(intent, 0); 

thats why I am confused with where and how should I implement onActivityResult method because I cant do anything on testActivity . can anybody help me ?

V-Xtreme
  • 7,230
  • 9
  • 39
  • 79
  • why don;t you start the activity from testactivity then – stinepike Jan 16 '14 at 05:23
  • Can you be more clear about your confusion? Why the testactivity not accessible? if not then how can you write testActivity.getActivity() ? – Pankaj Kumar Jan 16 '14 at 05:25
  • testActivity is part of jar file .thats why I cant do any modification their . – V-Xtreme Jan 16 '14 at 05:30
  • Then simple answer is "You can't implement startActivityForResult" – Pankaj Kumar Jan 16 '14 at 05:34
  • @PankajKumar: but is there any other way so I can get the selected sound url in the my activity ? – V-Xtreme Jan 16 '14 at 05:40
  • Start your another activity (Assume A) from testActivity and then use startActivityForResult to call sound picker. Here you can get result into your activity (A). – Pankaj Kumar Jan 16 '14 at 05:45
  • If I could do that, probably I would not need to post this question .:) – V-Xtreme Jan 16 '14 at 05:49
  • :) You are not more clear. Why do you want to call Activity from an Activity which is into jar? I don't think this is the only way of do your task... It seems that you have more clear knowledge... so think about your current application work flow\ – Pankaj Kumar Jan 16 '14 at 05:51
  • My question is strait forward one . I dont know what is your confusion in this question. I am working with building native plugin in trigger io so using activity from jar is my requirement. But that is not the part of question , it was very clear like can I do or not .I dont know why you are taking so interest in jar file ? – V-Xtreme Jan 16 '14 at 05:56

0 Answers0