首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Android >

Android 实现Activity靠山运行

2013-09-11 
Android 实现Activity后台运行第一种方法?void startActivitySafely(Intent intent) {intent.addFlags(Int

Android 实现Activity后台运行

第一种方法

?

void startActivitySafely(Intent intent) {intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);try {startActivity(intent);} catch (ActivityNotFoundException e) {Toast.makeText(this, R.string.unabletoopensoftware,Toast.LENGTH_SHORT).show();} catch (SecurityException e) {Toast.makeText(this, R.string.unabletoopensoftware,Toast.LENGTH_SHORT).show();Log.e(TAG,"Launcher does not have the permission to launch "+ intent+ ". Make sure to create a MAIN intent-filter for the corresponding activity "+ "or use the exported attribute for this activity.",e);}}

?

1 楼 384444165 2010-11-11   so good .Thanks

热点排行