我正在尝试在我的安卓应用程序中添加Google Maps v2 API的法律说明,可以通过调用GooglePlayServicesUtil.getOpenSourceSoftwareLicenseInfo()
来获取。
因此,我的代码如下:
String LicenseInfo = GooglePlayServicesUtil
.getOpenSourceSoftwareLicenseInfo(getApplicationContext());
AlertDialog.Builder LicenseDialog = new AlertDialog.Builder(MyActivity.this);
LicenseDialog.setTitle("Lagal Notices");
LicenseDialog.setMessage(LicenseInfo);
LicenseDialog.show();
但是当我执行这段代码时,系统需要大约10秒钟才能显示对话框(考虑到我的设备是OnePlus One,这似乎非常奇怪)。
如果我尝试用一个简单(更短)的字符串替换LicenseInfo,那么对话框会很快打开。所以我认为问题在于从Google play utils检索到的法律通知信息的长度。
我该如何解决这个问题?