2016-01-14 126 views
0

我相信这是正确的版本,不明白为什么会出现错误。日志中没有任何内容出现。当从应用程序发送“url”到应用程序B出现错误,并中止所有。应用程序A将URL发送到应用程序B

应用A按钮

Intent intent = new Intent(Intent.ACTION_VIEW); 
intent.putExtra("url", "http://46.182.25.34:1935/tv/1420/playlist.m3u8"); 
intent.setPackage("ro.vrt.exo"); 
intent.setClassName("ro.vrt.exo", "ro.vrt.exo.MainActivity"); 
startActivity(intent); 

应用B(小型播放)

Bundle bundle = getIntent().getExtras(); 
String url = bundle.getString("url"); 

emVideoView = (EMVideoView)findViewById(R.id.video_play_activity_video_view); 
emVideoView.setOnPreparedListener(this); 

//For now we just picked an arbitrary item to play. More can be found at 
//https://archive.org/details/more_animation 
emVideoView.setVideoURI(Uri.parse(url)); 
+1

你应该发布你得到的错误。 – user3804769

+0

作为两个不同的应用程序模拟器什么都没有出现只有应用程序停止 –

+0

放在你的代码周围尝试/抓住并显示你在烤面包中捕获的错误。 – StephaneM

回答

0

日志:

10月1日至14日:50:06.687 17571-17571/ro.grupulvrt .virtualromaniatvvrt E/AndroidRuntime:致命例外:main 进程:ro.grupulvrt.virtualromaniatvvrt,PID:17571 java.lang.SecurityException:Permission Denial:从ProcessRecord {21765e9 17571:}开始Intent {act = android.intent.action.VIEW pkg = ro.vrt.exo cmp = ro.vrt.exo/.MainActivity(has extras) (parcel.Parcel.readException)中的uid 10061 从android.os.Parcel.readException(Parcel.java:1546) 处导出的文件(ro.grupulvrt.virtualromaniatvvrt/u0a62}(pid = 17571,uid = 10062) (Activity.java:java:1499) at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:2430) at android.app.Instrumentation.execStartActivity(Instrumentation.java:1496) at android.app.Activity.startActivityForResult(Activity.java: 3745) at android.app.Activity.startActi vityForResult(Activity.java:3706) at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:784) at android.app.Activity.startActivity(Activity.java:4016) at android.app。 (android.view.java:4780) at android.view .View $ PerformClick.run(View.java:19866) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) 在java.lang.reflect.Method.invoke(本地方法) 上的android.app.ActivityThread.main(ActivityThread.java:5254) 。 lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:903) at com.android.internal.os.ZygoteInit.main( ZygoteInit.java:698)

我在项目manifest.xml中添加了android:exported =“true”,现在工作正常。

相关问题