2016-02-17 31 views

回答

0

你可以在你的代碼導入了所有必需的課程。作爲你的片段,你忘了延長這一點,但你已經擴展了AppCompatActivity,這樣你就不能在同一個活動中擴展另一個類。你需要做的是在MyVoiceActivity內部創建另一個班級,並在該班級中擴展VoiceInteractor.ConfirmationRequest

您的活動將是這個樣子

public class MyVoiceActivity extends AppCompatActivity{ 

     class Confirm extends VoiceInteractor.ConfirmationRequest { 

      //All method you wanted goes here 

     } 

} 
+0

@PushkarSuman當然,它必須是... –

+0

,但onResume函數必須在我們擴展VoiceInteractor的內部類之外。 ConfirmationRequest –

+0

@PushkarSuman我真的很抱歉兄弟。這是我發現的最噁心的教程。什麼是[this](https://github.com/android/platform_frameworks_base/blob/master/core/java/android/app/VoiceInteractor.java)?一個爲您的問題.. –