2
感謝您的閱讀。TabHost在顯示新活動一段時間後顯示默認活動
我面臨着在那裏,當我在我的TabHost
開始新Activity
一個問題,新的Activity
只顯示了幾秒鐘在Tab
返回默認Activity
之前。
我使用TabHost在我的應用程序中佈置5個選項卡。在其中一個選項卡,我開始一個新的Activity
如下:
Intent intent = new Intent(this, NewActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
LocalActivityManager manager = MyActivityGroup.ActivityGroup.getLocalActivityManager();
MyActivityGroup.ActivityGroup.replaceView(manager.startActivity("NewActivity", intent).getDecorView());
在這種NewActivity
S'onCreate()
,我打電話語音識別庫startRecord()
方法,執行如下:
private void startRecognition() {
try {
recognizer.startRecord(new SpeechRecognizerEvent() {
@Override
public void onRecognitionComplete(SpeechResult result) {
//get result data
}
}
我所知道的是在AndroidManifest.xml
中存在與此庫相關的SpeechFrameworkActivity
。
如果我註釋掉撥打startRecord()
方法,NewActivity
不會消失並繼續顯示。
我只是無知什麼是錯的。
從日誌中,我看到的是這樣的一行:
09-21 21:16:44.860: DEBUG/PhoneWindow(6737): couldn't save which view has focus because the focused view [email protected] has no id.
我想在我的MainTabActivity
使用但這並沒有解決問題。
請幫忙!任何幫助/指針將非常感謝!