【发布时间】:2012-05-08 22:16:07
【问题描述】:
我基本上使用的是锻钛 (Nav Controller) 的导航控制器。我也在尝试使用下面的代码启动各种网页。问题是,在应用程序中导航一段时间后,意图似乎不再启动活动。
有没有其他人遇到过类似的问题?如果有,是如何解决的?
感谢您的宝贵时间
exports.openWebPage = function(url) {
if (Ti.Network.online) {
if (Ti.Platform.osname === 'android') {
var intent = Ti.Android.createIntent({
action: Ti.Android.ACTION_VIEW,
data: encodeURI(url),
className: 'com.android.browser.BrowserActivity',
packageName: 'com.android.browser'
});
intent.addCategory(Ti.Android.CATEGORY_BROWSABLE);
Ti.Android.currentActivity.startActivity(intent);
Ti.API.info('openWebPage: ' + url);
}
else {
Ti.Platform.openURL(url);
Ti.API.info('openWebPage: ' + url);
}
}
else {
alert('Please establish an internet connection first');
}
};
【问题讨论】:
-
您找到解决方案了吗?在我的应用程序进入睡眠状态并将其恢复后,我似乎遇到了类似的问题。
Ti.Android.currentActivity.startActivity(intent);什么都不做,没有错误,什么都没有。
标签: android android-intent titanium